Skip to content

Commit 11aa261

Browse files
committed
fix
1 parent b25d990 commit 11aa261

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,9 @@ fn gen_log(
598598

599599
// fn(a: usize, b: usize) => "a = {a:?}, b = {b:?}"
600600
fn gen_input_format(sig: &Signature) -> String {
601-
let mut input_format = String::new();
602-
for (i, input) in sig.inputs.iter().enumerate() {
603-
if i > 0 {
604-
input_format.push_str(", ");
605-
}
601+
let mut args = vec![];
602+
603+
for input in &sig.inputs {
606604
match input {
607605
FnArg::Typed(PatType { pat, .. }) => {
608606
if let Pat::Ident(pat_ident) = &**pat {
@@ -611,15 +609,16 @@ fn gen_input_format(sig: &Signature) -> String {
611609
if ident.starts_with("__arg") {
612610
continue;
613611
}
614-
input_format.push_str(&format!("{ident} = {{{ident}:?}}"));
612+
args.push(format!("{ident} = {{{ident}:?}}"));
615613
}
616614
}
617615
FnArg::Receiver(_) => {
618-
input_format.push_str("self");
616+
args.push("self".to_string());
619617
}
620618
}
621619
}
622-
input_format
620+
621+
args.join(", ")
623622
}
624623

625624
fn gen_output_format() -> String {

0 commit comments

Comments
 (0)