Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Using reduce with Rust 1.51.0 #4

Open
cdisselkoen opened this issue Apr 6, 2021 · 1 comment
Open

Using reduce with Rust 1.51.0 #4

cdisselkoen opened this issue Apr 6, 2021 · 1 comment

Comments

@cdisselkoen
Copy link

Rust 1.51.0 introduced a .reduce() method on Iterator. This leads to the awkward situation where use reduce::Reduce; leads to a compile-time error on Rust 1.51.0, because .reduce() on an Iterator is now ambiguous whether we mean Reduce::reduce() or Iterator::reduce(). Ideally I'd like to resolve this for my crate's users without restricting the Rust version (further) - i.e., I'd like my crate to compile with both 1.50.0 and 1.51.0.

The first solution I thought of is to use rustversion to only use reduce::Reduce; on Rust 1.50.0 and earlier. But perhaps something could be done in this crate to make the process transparent? I'm not sure if there's any functionality difference between this crate's .reduce() and the new one in 1.51.0, but if the new standard one is preferable, then perhaps this crate could itself just pub use std::iter::Iterator::reduce; on 1.51.0+.

@cdisselkoen
Copy link
Author

Friendly ping on this - I've worked around it on my end with rustversion, but I still wonder if a workaround in this crate would be better / more transparent.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant