Skip to content

Commit

Permalink
Replace hash_u64 with hash_u8
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed May 15, 2024
1 parent 140dc0b commit 36651b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ impl PythonBindGenerator {

fn generate_enum_hash_method(&mut self) {
self.write_str(" pub fn __hash__(&self) -> u64 {");
self.write_str(" crate::hash_u64(*self as u64)");
self.write_str(" crate::hash_u8(*self as u8)");
self.write_str(" }");
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub fn flat_err_to_py(err: flatbuffers::InvalidFlatbuffer) -> PyErr {
InvalidFlatbuffer::new_err(err_msg)
}

pub fn hash_u64(num: u64) -> u64 {
pub fn hash_u8(num: u8) -> u64 {
let mut hasher = DefaultHasher::new();
num.hash(&mut hasher);
hasher.finish()
Expand Down

0 comments on commit 36651b1

Please sign in to comment.