Giter Site home page Giter Site logo

Comments (12)

reem avatar reem commented on September 24, 2024

I believe the current (IMO annoying :P) convention is to use newtypes.

from collect-rs.

Gankra avatar Gankra commented on September 24, 2024

@aturon has plans for some kind of macro to make this more ergonomic.

But yeah, annoying.

from collect-rs.

Gankra avatar Gankra commented on September 24, 2024

Strictly speaking we could not bother since we make no back-compat guarantees at all.

from collect-rs.

aturon avatar aturon commented on September 24, 2024

@gankro I believe a few such macros are currently in use in std for this purpose.

from collect-rs.

aturon avatar aturon commented on September 24, 2024

(I think it'd be interesting to try to provide a robust form of these macros in crates.io, but I won't have time to do that myself any time soon.)

from collect-rs.

apasel422 avatar apasel422 commented on September 24, 2024

Is there even a reason to have these iterators? Adaptors provide the same functionality without the combinatoric explosion of key-value/mutable-immutable/forward-reverse/subrange variants.

from collect-rs.

Gankra avatar Gankra commented on September 24, 2024

Hmm... I... Don't disagree.

from collect-rs.

tbu- avatar tbu- commented on September 24, 2024

You're making the intent clearer if you ask for keys or values only – also there's the possibility of implementing "just getting the keys" in a more efficient way, because it doesn't have to touch the values.

from collect-rs.

reem avatar reem commented on September 24, 2024

Ideally there's a way to get a keys iterator that doesn't contain the values type - this has been a problem for me in the past.

Thanks,
Jonathan Reem

On Wed, Jan 28, 2015 at 12:26 PM, tbu- [email protected] wrote:

You're making the intent clearer if you ask for keys or values only – also there's the possibility of implementing "just getting the keys" in a more efficient way, because it doesn't have to touch the values.

Reply to this email directly or view it on GitHub:
#99 (comment)

from collect-rs.

apasel422 avatar apasel422 commented on September 24, 2024

@reem As written, both forms (type alias and wrapper struct) reference the value type. Without being space-inefficient or using trait objects or unsafe code, I don't see how they can be written without being parameterized over the value.

from collect-rs.

reem avatar reem commented on September 24, 2024

Depending on the data structure it is sometimes possible to do it unsafely.

Thanks,
Jonathan Reem

On Wed, Jan 28, 2015 at 12:38 PM, Andrew Paseltiner
[email protected] wrote:

@reem As written, both forms (type alias and wrapper struct) reference the value type. Without being space-inefficient or using trait objects or unsafe code, I don't see how they can be written without being parameterized over the value.

Reply to this email directly or view it on GitHub:
#99 (comment)

from collect-rs.

apasel422 avatar apasel422 commented on September 24, 2024

Closing because trie is now in an external crate. CC contain-rs/trie#4.

from collect-rs.

Related Issues (20)

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.