mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
More manual clippy fixes
This commit is contained in:
parent
b8ddcb0652
commit
eceaf94f19
32 changed files with 141 additions and 159 deletions
|
@ -155,14 +155,11 @@ fn compile_error_expand(
|
|||
tt: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
if tt.count() == 1 {
|
||||
match &tt.token_trees[0] {
|
||||
tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => {
|
||||
let s = it.text.as_str();
|
||||
if s.contains('"') {
|
||||
return Ok(quote! { loop { #it }});
|
||||
}
|
||||
if let tt::TokenTree::Leaf(tt::Leaf::Literal(it)) = &tt.token_trees[0] {
|
||||
let s = it.text.as_str();
|
||||
if s.contains('"') {
|
||||
return Ok(quote! { loop { #it }});
|
||||
}
|
||||
_ => {}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -15,14 +15,13 @@ macro_rules! __quote {
|
|||
( @SUBTREE $delim:ident $($tt:tt)* ) => {
|
||||
{
|
||||
let children = $crate::__quote!($($tt)*);
|
||||
let subtree = tt::Subtree {
|
||||
tt::Subtree {
|
||||
delimiter: Some(tt::Delimiter {
|
||||
kind: tt::DelimiterKind::$delim,
|
||||
id: tt::TokenId::unspecified(),
|
||||
}),
|
||||
token_trees: $crate::quote::IntoTt::to_tokens(children),
|
||||
};
|
||||
subtree
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue