Skip to content

Commit 4b96229

Browse files
committed
clippy: fix warnings for redundant field names in struct initialization
Refactor codegen.rs to use write_line instead of field_entry for client initialization Signed-off-by: Chasing1020 <643601464@qq.com>
1 parent 0210c7a commit 4b96229

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ impl<'a> ServiceGen<'a> {
505505
w.impl_self_block(&self.client_name(), |w| {
506506
w.pub_fn("new(client: ::ttrpc::Client) -> Self", |w| {
507507
w.expr_block(&self.client_name(), |w| {
508-
w.field_entry("client", "client");
508+
w.write_line("client,");
509509
});
510510
});
511511

@@ -527,7 +527,7 @@ impl<'a> ServiceGen<'a> {
527527
w.impl_self_block(&self.client_name(), |w| {
528528
w.pub_fn("new(client: ::ttrpc::r#async::Client) -> Self", |w| {
529529
w.expr_block(&self.client_name(), |w| {
530-
w.field_entry("client", "client");
530+
w.write_line("client,");
531531
});
532532
});
533533

0 commit comments

Comments
 (0)