Git Product home page Git Product logo

hash32's Issues

"can't find crate for `hash32`"

When depending on the hash32 create, but not the hash crate, I'm getting the following error when trying to derive Hash32:

error[E0463]: can't find crate for `hash32`                                                              
   --> src/mac.rs:299:40                                                                                 
    |                                                                                                    
299 | #[derive(Clone, Copy, Debug, Eq, Hash, Hash32, PartialEq)]                                         
    |                                        ^^^^^^ can't find crate                                     

If I also add a dependency on hash32, the error goes away and everything works as expected.

Extend `core::hash` instead of replacing it

It's possible to implement hash32::Hasher as an extension of core::hash::Hasher, rather than a replacement:

pub trait Hasher: core::hash::Hasher {
    // This isn't the best name, but calling it `finish` would conflict with the method of `core::hash::Hasher`.
    fn finish32(&self) -> u32;
}

This would allow using the standard Hash type instead of needing a custom version, and also remove the need for a custom derive macro.

Obviously, this would be a breaking change. Even if everything else was kept the same, and a blanket impl of core::hash::Hasher for hash32::Hasher was used instead of modifying hash32::Hasher, that would break any crates which already implemented both.

I've made a draft implementation at https://github.com/Liamolucko/hash32/tree/use-std.

roadmap to v1.0.0?

do you have a roadmap to releasing a v1.0.0? it would be cool if you could create the tickets for what you think is missing for v1.0.0 and assign them to a v1.0.0 milestone.

rationale: theoretically, one should only build on released software, so using 0.x pre-releases for production software isn't looked on too well. in the rust eco-system there are sadly a lot of crates which stay on 0.x for years but are heavily used. having a roadmap helps in understanding why a crate is not yet released as 1.x (or higher) and allows analysing the trade-offs (is it acceptable to use the crate in production even though these features are missing?).

furthermore, this would help with contributors: they know where work still needs to be done and they can offer their help focused on these topics.

specifically this seems to block the heapless crate from releasing an 1.0.0 release: rust-embedded/heapless#410 (comment)

with over 9 million downloads the hash32 crate is heavily used in the (embedded) rust ecosystem (see also the dependent crates, primarily through heapless) and having a stable release would be beneficial for all of them.

this crate seems to be very stable (no open issues, only one open PR, no commits since a year), indicating that it'd be a good candidate for an 1.0.0 release (either just re-release the last release as 1.0.0 or optionally include some cleanups along with it if needed).

Add support for enums

I'm getting the following error when trying to derive Hash32 for an enum:

error: proc-macro derive panicked
   --> src/mac.rs:464:40
    |
464 | #[derive(Clone, Copy, Debug, Eq, Hash, Hash32, PartialEq)]
    |                                        ^^^^^^
    |
    = help: message: #[derive(Hash)] doesn't currently support `enum` and `union`

It would be very useful to have support for enums!

Add support for tuples

It seems that tuples containing only types that implement hash32::Hash don't implement Hash themselves:

the trait bound `(u16, u16): hash32::Hash` is not satisfied
  --> examples/dw1000_rx_tx.rs:41:27
   |
41 |     let mut known_nodes = FnvIndexSet::<_, heapless::consts::U64>::new();
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `hash32::Hash` is not implemented for `(u16, u16)`
   |
   = note: required by `<heapless::indexset::IndexSet<T, N, hash32::BuildHasherDefault<S>>>::new`

It would be very useful to have this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.