Auto merge of #16469 - Young-Flash:ci_typos, r=lnicola

internal: add typos check CI (part 2)

follow up https://github.com/rust-lang/rust-analyzer/pull/16448
This commit is contained in:
bors 2024-02-02 12:02:48 +00:00
commit 8f6a72871e
22 changed files with 450 additions and 208 deletions

View file

@ -284,13 +284,13 @@ fn convert_path(
}
fn convert_path_tt(db: &dyn ExpandDatabase, tt: &[tt::TokenTree]) -> Option<ModPath> {
let mut leafs = tt.iter().filter_map(|tt| match tt {
let mut leaves = tt.iter().filter_map(|tt| match tt {
tt::TokenTree::Leaf(leaf) => Some(leaf),
tt::TokenTree::Subtree(_) => None,
});
let mut segments = smallvec::smallvec![];
let kind = match leafs.next()? {
tt::Leaf::Punct(tt::Punct { char: ':', .. }) => match leafs.next()? {
let kind = match leaves.next()? {
tt::Leaf::Punct(tt::Punct { char: ':', .. }) => match leaves.next()? {
tt::Leaf::Punct(tt::Punct { char: ':', .. }) => PathKind::Abs,
_ => return None,
},
@ -300,7 +300,7 @@ fn convert_path_tt(db: &dyn ExpandDatabase, tt: &[tt::TokenTree]) -> Option<ModP
tt::Leaf::Ident(tt::Ident { text, .. }) if text == "self" => PathKind::Super(0),
tt::Leaf::Ident(tt::Ident { text, .. }) if text == "super" => {
let mut deg = 1;
while let Some(tt::Leaf::Ident(tt::Ident { text, .. })) = leafs.next() {
while let Some(tt::Leaf::Ident(tt::Ident { text, .. })) = leaves.next() {
if text != "super" {
segments.push(Name::new_text_dont_use(text.clone()));
break;
@ -316,7 +316,7 @@ fn convert_path_tt(db: &dyn ExpandDatabase, tt: &[tt::TokenTree]) -> Option<ModP
}
_ => return None,
};
segments.extend(leafs.filter_map(|leaf| match leaf {
segments.extend(leaves.filter_map(|leaf| match leaf {
::tt::Leaf::Ident(ident) => Some(Name::new_text_dont_use(ident.text.clone())),
_ => None,
}));