More manual clippy fixes

This commit is contained in:
Kirill Bulatov 2020-02-18 15:32:19 +02:00
parent b8ddcb0652
commit eceaf94f19
32 changed files with 141 additions and 159 deletions

View file

@ -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 }});
}
_ => {}
};
}

View file

@ -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
}
}
};