Skip to content

Commit

Permalink
remove unnecessary space before function name in .d.ts file
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 1, 2019
1 parent 019a086 commit 23ccd3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/cli-support/src/js/js2rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,11 @@ impl<'a, 'b> Js2Rust<'a, 'b> {
.map(|s| format!("{}: {}", s.0, s.1))
.collect::<Vec<_>>()
.join(", ");
let mut ts = format!("{} {}({})", prefix, self.js_name, ts_args);
let mut ts = if prefix.is_empty() {
format!("{}({})", self.js_name, ts_args)
} else {
format!("{} {}({})", prefix, self.js_name, ts_args)
};
if self.constructor.is_none() {
ts.push_str(": ");
ts.push_str(&self.ret_ty);
Expand Down

0 comments on commit 23ccd3b

Please sign in to comment.