Don't print a space after quoted function names.

This commit is contained in:
Jakob Stoklund Olesen
2016-07-08 11:44:20 -07:00
parent b710dd8464
commit 3c5c5a9e40

View File

@@ -63,7 +63,7 @@ fn write_spec(w: &mut Write, func: &Function) -> Result {
if !needs_quotes(&func.name) { if !needs_quotes(&func.name) {
write!(w, "function {}{}", func.name, sig) write!(w, "function {}{}", func.name, sig)
} else { } else {
write!(w, "function \"{}\" {}", escaped(&func.name), sig) write!(w, "function \"{}\"{}", escaped(&func.name), sig)
} }
} }
@@ -234,7 +234,7 @@ mod tests {
#[test] #[test]
fn basic() { fn basic() {
let mut f = Function::new(); let mut f = Function::new();
assert_eq!(function_to_string(&f), "function \"\" () {\n}\n"); assert_eq!(function_to_string(&f), "function \"\"() {\n}\n");
f.name.push_str("foo"); f.name.push_str("foo");
assert_eq!(function_to_string(&f), "function foo() {\n}\n"); assert_eq!(function_to_string(&f), "function foo() {\n}\n");