Skip to content

Commit

Permalink
Specialize nth_back (MSRV 1.37)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed May 16, 2024
1 parent 864eae4 commit abb6f04
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
rust:
- 1.36.0 # MSRV
- 1.37.0 # MSRV
- stable
- beta
- nightly
Expand All @@ -38,7 +38,7 @@ jobs:
toolchain: ${{ matrix.rust }}

- name: MSRV dependencies
if: matrix.rust == '1.36.0'
if: matrix.rust == '1.37.0'
run: |
cargo generate-lockfile
cargo update -p serde_json --precise 1.0.99
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "either"
version = "1.11.0"
authors = ["bluss"]
edition = "2018"
rust-version = "1.36"
rust-version = "1.37"

license = "MIT OR Apache-2.0"
repository = "https://github.com/rayon-rs/either"
Expand Down
14 changes: 6 additions & 8 deletions src/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,9 @@ where
for_both!(*self, ref mut inner => inner.next_back())
}

// TODO(MSRV): This was stabilized in Rust 1.37
// fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
// for_both!(*self, ref mut inner => inner.nth_back(n))
// }
fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
for_both!(*self, ref mut inner => inner.nth_back(n))
}

fn rfold<Acc, G>(self, init: Acc, f: G) -> Acc
where
Expand Down Expand Up @@ -279,10 +278,9 @@ where
Some(map_either!(self.inner, ref mut inner => inner.next_back()?))
}

// TODO(MSRV): This was stabilized in Rust 1.37
// fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
// Some(map_either!(self.inner, ref mut inner => inner.nth_back(n)?))
// }
fn nth_back(&mut self, n: usize) -> Option<Self::Item> {
Some(map_either!(self.inner, ref mut inner => inner.nth_back(n)?))
}

fn rfold<Acc, G>(self, init: Acc, f: G) -> Acc
where
Expand Down

0 comments on commit abb6f04

Please sign in to comment.