From 23ccd3b5c1cb47b13260cb0ebadc4439d3f0c23e Mon Sep 17 00:00:00 2001 From: rhysd Date: Fri, 1 Feb 2019 16:07:12 +0900 Subject: [PATCH] remove unnecessary space before function name in .d.ts file --- crates/cli-support/src/js/js2rust.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/cli-support/src/js/js2rust.rs b/crates/cli-support/src/js/js2rust.rs index aae626ed..1e31e5a1 100644 --- a/crates/cli-support/src/js/js2rust.rs +++ b/crates/cli-support/src/js/js2rust.rs @@ -734,7 +734,11 @@ impl<'a, 'b> Js2Rust<'a, 'b> { .map(|s| format!("{}: {}", s.0, s.1)) .collect::>() .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);