Skip to content

Commit 43b1ae0

Browse files
committed
cargo clippy --fix
1 parent 628f701 commit 43b1ae0

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

crates/hir-expand/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl Attr {
235235
let (path, input) = tt.split_at(path_end);
236236
let path = Interned::new(ModPath::from_tt(db, path)?);
237237

238-
let input = match input.get(0) {
238+
let input = match input.first() {
239239
Some(tt::TokenTree::Subtree(tree)) => {
240240
Some(Interned::new(AttrInput::TokenTree(Box::new(tree.clone()))))
241241
}

crates/hir-expand/src/mod_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn convert_path(
232232
ast::PathSegmentKind::SuperKw => {
233233
let mut deg = 1;
234234
let mut next_segment = None;
235-
while let Some(segment) = segments.next() {
235+
for segment in segments.by_ref() {
236236
match segment.kind()? {
237237
ast::PathSegmentKind::SuperKw => deg += 1,
238238
ast::PathSegmentKind::Name(name) => {

crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<'p> MatchCheckCtx<'p> {
237237
ctor = Or;
238238
// Collect here because `Arena::alloc_extend` panics on reentrancy.
239239
let subpats: SmallVec<[_; 2]> =
240-
pats.into_iter().map(|pat| self.lower_pat(pat)).collect();
240+
pats.iter().map(|pat| self.lower_pat(pat)).collect();
241241
fields = self.pattern_arena.alloc_extend(subpats);
242242
}
243243
}

crates/hir-ty/src/mir/eval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ impl Evaluator<'_> {
17151715
let v: Cow<'_, [u8]> = if size != v.len() {
17161716
// Handle self enum
17171717
if size == 16 && v.len() < 16 {
1718-
Cow::Owned(pad16(&v, false).to_vec())
1718+
Cow::Owned(pad16(v, false).to_vec())
17191719
} else if size < 16 && v.len() == 16 {
17201720
Cow::Borrowed(&v[0..size])
17211721
} else {

crates/hir/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ fn modpath_from_str(link: &str) -> Option<ModPath> {
311311
"self" => PathKind::Super(0),
312312
"super" => {
313313
let mut deg = 1;
314-
while let Some(segment) = parts.next() {
314+
for segment in parts.by_ref() {
315315
if segment == "super" {
316316
deg += 1;
317317
} else {

0 commit comments

Comments
 (0)