Skip to content

Commit

Permalink
chore: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Dec 2, 2023
1 parent e2b0dfe commit 57183d1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions yerpc/src/typescript.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Write;
use std::io;
use std::path::Path;
use typescript_type_def::{type_expr::TypeInfo, write_definition_file, DefinitionFileOptions};
Expand Down Expand Up @@ -92,10 +93,10 @@ impl Method {
(output, "notification")
};
let docs = if let Some(docs) = &self.docs {
let docs = docs
.split('\n')
.map(|s| format!(" *{s}\n"))
.collect::<String>();
let docs = docs.split('\n').fold(String::new(), |mut output, s| {
let _ = writeln!(output, " *{s}");
output
});
format!(" /**\n{docs} */")
} else {
"".into()
Expand Down

0 comments on commit 57183d1

Please sign in to comment.