Giter VIP home page Giter VIP logo

Comments (4)

ripytide avatar ripytide commented on June 12, 2024

Also, FromIterator is not supposed to fail and yet it will panic if you feed it an invalid RangeBounds which is quite bad.

from nodit.

ripytide avatar ripytide commented on June 12, 2024

Instead I recommend using append_* functions once they land in #7

If you need to build a RangeBounds* from an Iterator I recommend looping through the values with a for loop and inserting the with the intended insert_* method.

from nodit.

ripytide avatar ripytide commented on June 12, 2024

The first attempt at a fix in #16 failed as I forgot about all the places in the crate where I use TryFrom<[]>.

I think the best solution her would be to switch over to a new function RangeBoundsMap::from_slice_strict and write variations for the other insert functions also, since the alternative without custom functions would be to manually use insert_*s everywhere in the docs which would be way worse.

from nodit.

ripytide avatar ripytide commented on June 12, 2024

An question popped up whilst implementing the from_slice* functions. The from_slice_overwrite doesn't really make any sense! Why would anyone want to convert between a slice of RangeBounds by sequentially overwriting them??? But I guess since it makes everything consistent I will keep it. Consistency is key after all.

from nodit.

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.