Skip to content

Unable to load an invalid hash table in debug mode #23

@carlsverre

Description

@carlsverre

Due to the debug_assert here:

debug_assert_eq!(header.sanity_check::<C>(raw_bytes.len()), Ok(()));

it's currently impossible (as far as I can tell) to load an invalid HashTable in debug mode and handle the error at runtime. Perhaps that debug assert should be moved into from_raw_bytes_unchecked?

In my use case I'm using ODHT to store an index within some serialized files. The code which loads these files uses from_raw_bytes to load the index and then checks it's Result to see if it failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions