Skip to content

Commit 7bebff4

Browse files
lqdcompiler-errors
authored andcommitted
skip next is nth
1 parent 919027b commit 7bebff4

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

crates/formality-core/src/collections.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<T: Ord + Clone> SetExt<T> for Set<T> {
113113

114114
fn split_nth(&self, i: usize) -> Option<(T, Set<T>)> {
115115
let mut s = self.clone();
116-
let item = self.iter().skip(i).next()?;
116+
let item = self.iter().nth(i)?;
117117
let item = s.take(item).unwrap();
118118
Some((item, s))
119119
}

crates/formality-core/src/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ where
343343
.zip(0..)
344344
.all(|(s_j, j)| i == j || Self::is_preferable(s_i, s_j))
345345
{
346-
let s_i = self.successes.into_iter().skip(i).next().unwrap();
346+
let s_i = self.successes.into_iter().nth(i).unwrap();
347347
// It's better to print this result alongside the main parsing section.
348348
drop(guard);
349349
tracing::trace!("best parse = `{:?}`", s_i);

crates/formality-macros/src/attrs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ where
6969
attrs
7070
.iter()
7171
.filter(|a| a.path().is_ident(name))
72-
.skip(1)
73-
.next()
72+
.nth(1)
7473
.unwrap()
7574
.path()
7675
.span(),

0 commit comments

Comments
 (0)