mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-27 20:35:09 +00:00
cargo clippy --fix
This commit is contained in:
parent
628f70156e
commit
43b1ae0446
5 changed files with 5 additions and 5 deletions
|
@ -235,7 +235,7 @@ impl Attr {
|
||||||
let (path, input) = tt.split_at(path_end);
|
let (path, input) = tt.split_at(path_end);
|
||||||
let path = Interned::new(ModPath::from_tt(db, path)?);
|
let path = Interned::new(ModPath::from_tt(db, path)?);
|
||||||
|
|
||||||
let input = match input.get(0) {
|
let input = match input.first() {
|
||||||
Some(tt::TokenTree::Subtree(tree)) => {
|
Some(tt::TokenTree::Subtree(tree)) => {
|
||||||
Some(Interned::new(AttrInput::TokenTree(Box::new(tree.clone()))))
|
Some(Interned::new(AttrInput::TokenTree(Box::new(tree.clone()))))
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ fn convert_path(
|
||||||
ast::PathSegmentKind::SuperKw => {
|
ast::PathSegmentKind::SuperKw => {
|
||||||
let mut deg = 1;
|
let mut deg = 1;
|
||||||
let mut next_segment = None;
|
let mut next_segment = None;
|
||||||
while let Some(segment) = segments.next() {
|
for segment in segments.by_ref() {
|
||||||
match segment.kind()? {
|
match segment.kind()? {
|
||||||
ast::PathSegmentKind::SuperKw => deg += 1,
|
ast::PathSegmentKind::SuperKw => deg += 1,
|
||||||
ast::PathSegmentKind::Name(name) => {
|
ast::PathSegmentKind::Name(name) => {
|
||||||
|
|
|
@ -237,7 +237,7 @@ impl<'p> MatchCheckCtx<'p> {
|
||||||
ctor = Or;
|
ctor = Or;
|
||||||
// Collect here because `Arena::alloc_extend` panics on reentrancy.
|
// Collect here because `Arena::alloc_extend` panics on reentrancy.
|
||||||
let subpats: SmallVec<[_; 2]> =
|
let subpats: SmallVec<[_; 2]> =
|
||||||
pats.into_iter().map(|pat| self.lower_pat(pat)).collect();
|
pats.iter().map(|pat| self.lower_pat(pat)).collect();
|
||||||
fields = self.pattern_arena.alloc_extend(subpats);
|
fields = self.pattern_arena.alloc_extend(subpats);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1715,7 +1715,7 @@ impl Evaluator<'_> {
|
||||||
let v: Cow<'_, [u8]> = if size != v.len() {
|
let v: Cow<'_, [u8]> = if size != v.len() {
|
||||||
// Handle self enum
|
// Handle self enum
|
||||||
if size == 16 && v.len() < 16 {
|
if size == 16 && v.len() < 16 {
|
||||||
Cow::Owned(pad16(&v, false).to_vec())
|
Cow::Owned(pad16(v, false).to_vec())
|
||||||
} else if size < 16 && v.len() == 16 {
|
} else if size < 16 && v.len() == 16 {
|
||||||
Cow::Borrowed(&v[0..size])
|
Cow::Borrowed(&v[0..size])
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -311,7 +311,7 @@ fn modpath_from_str(link: &str) -> Option<ModPath> {
|
||||||
"self" => PathKind::Super(0),
|
"self" => PathKind::Super(0),
|
||||||
"super" => {
|
"super" => {
|
||||||
let mut deg = 1;
|
let mut deg = 1;
|
||||||
while let Some(segment) = parts.next() {
|
for segment in parts.by_ref() {
|
||||||
if segment == "super" {
|
if segment == "super" {
|
||||||
deg += 1;
|
deg += 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue