Simplify some expressions with pointers and references

This commit is contained in:
Eduardo Sánchez Muñoz
2023-10-30 13:31:49 +01:00
committed by Amanieu d'Antras
parent 02156819c9
commit 9f741c5986
7 changed files with 12 additions and 12 deletions

View File

@@ -89,7 +89,7 @@ pub fn assert_instr(
syn::Pat::Ident(ref i) => &i.ident,
_ => panic!("must have bare arguments"),
};
if let Some(&(_, ref tokens)) = invoc.args.iter().find(|a| *ident == a.0) {
if let Some((_, tokens)) = invoc.args.iter().find(|a| *ident == a.0) {
input_vals.push(quote! { #tokens });
} else {
inputs.push(capture);
@@ -104,7 +104,7 @@ pub fn assert_instr(
v.clone().into_token_stream()
),
};
if let Some(&(_, ref tokens)) = invoc.args.iter().find(|a| c.ident == a.0) {
if let Some((_, tokens)) = invoc.args.iter().find(|a| c.ident == a.0) {
const_vals.push(quote! { #tokens });
} else {
panic!("const generics must have a value for tests");