diff --git a/Cargo.toml b/Cargo.toml index 3024267..254bf2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,8 @@ license = "MIT OR Apache-2.0" name = "hash32" repository = "https://github.com/japaric/hash32" version = "0.3.1" +edition = "2021" +rust-version = "1.56" [dependencies.byteorder] default-features = false diff --git a/README.md b/README.md index eeebdbb..7761eec 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,7 @@ at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. + +## Minimum Supported Rust Version (MSRV) +This crate is guaranteed to compile on stable Rust 1.56 and up. It *might* +compile with older versions but that may change in any new patch release. diff --git a/src/lib.rs b/src/lib.rs index 04a32be..d14bc26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -56,8 +56,8 @@ use core::fmt; use core::hash::BuildHasher; use core::marker::PhantomData; -pub use fnv::Hasher as FnvHasher; -pub use murmur3::Hasher as Murmur3Hasher; +pub use crate::fnv::Hasher as FnvHasher; +pub use crate::murmur3::Hasher as Murmur3Hasher; mod fnv; mod murmur3; diff --git a/src/murmur3.rs b/src/murmur3.rs index 8bbdbe4..f0c9082 100644 --- a/src/murmur3.rs +++ b/src/murmur3.rs @@ -139,7 +139,7 @@ impl core::hash::Hasher for Hasher { let mid = 4 - index; let head = unsafe { slice::from_raw_parts(bytes.as_ptr(), mid) }; let body = unsafe { - slice::from_raw_parts(bytes.as_ptr().offset(mid as isize), len - mid) + slice::from_raw_parts(bytes.as_ptr().add(mid), len - mid) }; // NOTE(unsafe) avoid calling `memcpy` on a 0-3 byte copy