Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Virgiel committed Nov 21, 2022
1 parent 35e6325 commit 7e42af4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cornucopia/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ impl GenCtx {
}

pub fn path(&self, depth: u8, name: impl Display) -> String {
let mut buff = String::new();
let depth = std::iter::repeat("super::").take(depth as usize);
code!(buff => $($depth)$name);
buff
code!($($depth)$name)
}

pub fn client_name(&self) -> &'static str {
Expand Down Expand Up @@ -98,7 +96,7 @@ impl PreparedField {
if call == self.name {
call
} else {
format!("{}: {}", self.name, call)
format!("{}: {call}", self.name)
}
}
}
Expand Down Expand Up @@ -538,7 +536,7 @@ fn gen_query_fn<W: Write>(w: &mut W, module: &PreparedModule, query: &PreparedQu
$($fields_name: row.get($fields_idx),)
})
}),
format!("<{path}>::from(it)"),
code!(<$path>::from(it)),
)
} else {
let field = &fields[0];
Expand Down

0 comments on commit 7e42af4

Please sign in to comment.