-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Once proc-macro-attribute #[trace(...)]
has test coverage and documentation covering the relevant code, it may be possible to simplify the logic within minitrace-macro/lib: transform_sig(...)
. Specifically, by eliminating these lines, (per this observation in PR #119):
minitrace-rust/minitrace-macro/src/lib.rs
Lines 259 to 275 in 819d611
for (i, arg) in sig.inputs.iter_mut().enumerate() { | |
match arg { | |
FnArg::Receiver(Receiver { | |
reference: Some(_), .. | |
}) => {} | |
FnArg::Receiver(arg) => arg.mutability = None, | |
FnArg::Typed(arg) => { | |
if let Pat::Ident(ident) = &mut *arg.pat { | |
ident.by_ref = None; | |
} else { | |
let positional = positional_arg(i, &arg.pat); | |
let m = mut_pat(&mut arg.pat); | |
arg.pat = parse_quote!(#m #positional); | |
} | |
} | |
} | |
} |
Metadata
Metadata
Assignees
Labels
No labels