GithubHelp home page GithubHelp logo

Comments (3)

Coca162 avatar Coca162 commented on September 23, 2024 2

unless we also increase the non-minor version

Since the crate is currently on major version 0 it is allowed to do breaking changes on minor versions:

Major version zero (0.y.z) is for initial development. Anything MAY change at any time. The public API SHOULD NOT be considered stable.

https://semver.org/#spec-item-4

from blst.

dot-asm avatar dot-asm commented on September 23, 2024

Formally speaking it's unreasonable to expect that users would have to modify their code unless we also increase the non-minor version. One can discuss that, but meanwhile why not start by suggesting an additional interface, say aggregate_iter? This would allow us to weigh pros and cons and maybe extend the approach...

from blst.

Coca162 avatar Coca162 commented on September 23, 2024

Having a aggregate_iter would also work, and it would allow for deprecation warnings to be put on current aggregate if it is decided to be removed in the future.

As for how users will have to modify their code if it's replaced, I think the only scenario will be one like this:

fn test() {
    let references_collection: [&usize; 4] = [&0, &0, &0, &0];

    // Works
    slice_of_ref(&references_collection);

    // Does not work, is a IntoIterator<Item = &&usize>
    into_iter_of_ref(&references_collection);
}

fn slice_of_ref(slice: &[&usize]) { }

fn into_iter_of_ref<'a>(slice: impl IntoIterator<Item = &'a usize>) { }

And can be fixed in either of these 2 ways:

// Consume collection, most likely not ideal
 into_iter_of_ref(references_collection);

// Copy to remove one reference
into_iter_of_ref(references_collection.iter().copied());

This could be possibly be remedied using some other generic trait, though I don't know of such way currently, and is most likely is not possible in current rust.

from blst.

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.