Skip to content

Commit

Permalink
Restore compatibility with Rust 1.56 (#4)
Browse files Browse the repository at this point in the history
Rust 1.56 is the first version with support for the 2021 edition.
Maintaining support for this version gives people an easy target when
determining the oldest compiler they can use.

Textwrap tries to stay compatible with the same Rust version, and this
is where I first saw that the MSRV had increased to 1.59 [1].

[1]: mgeisler/textwrap#472
  • Loading branch information
mgeisler committed Sep 29, 2022
1 parent 3e25950 commit ccfa18e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ where
let b = b.into_iter();
(1..min(a.len(), b.len()))
.rev()
.find(|&n| iter::zip(&a[a.len() - n..], b.clone()).all(|(x, y)| x == y.borrow()))
.find(|&n| {
a[a.len() - n..]
.iter()
.zip(b.clone())
.all(|(x, y)| x == y.borrow())
})
.unwrap_or(0)
}

Expand Down

0 comments on commit ccfa18e

Please sign in to comment.