From 0142191e51386ede07e70f61e0b47631a86ff2a4 Mon Sep 17 00:00:00 2001 From: Marcus Klaas Date: Sun, 27 Mar 2016 20:20:51 +0200 Subject: [PATCH] Remove trailing whitespace for fn types /w non-unit return --- src/types.rs | 2 +- tests/source/type_alias.rs | 2 ++ tests/target/type_alias.rs | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 7ac4bd1c674..5a8e456bedb 100644 --- a/src/types.rs +++ b/src/types.rs @@ -268,7 +268,7 @@ fn format_function_type<'a, I>(inputs: I, FunctionRetTy::Default(..) => String::new(), }; - let infix = if output.len() + list_str.len() > width { + let infix = if output.len() > 0 && output.len() + list_str.len() > width { format!("\n{}", (offset - 1).to_string(context.config)) } else { String::new() diff --git a/tests/source/type_alias.rs b/tests/source/type_alias.rs index e4429bb8ddf..93e155534ec 100644 --- a/tests/source/type_alias.rs +++ b/tests/source/type_alias.rs @@ -25,3 +25,5 @@ pub type Exactly100CharstoEqualWhereTest where T: Clone + Ord + Eq + SomeOtherTrait = Option; pub type Exactly101CharstoEqualWhereTest where T: Clone + Ord + Eq + SomeOtherTrait = Option; + +type RegisterPlugin = unsafe fn(pt: *const c_char, plugin: *mut c_void, data: *mut CallbackData); diff --git a/tests/target/type_alias.rs b/tests/target/type_alias.rs index d175aa60a67..16c77b273c1 100644 --- a/tests/target/type_alias.rs +++ b/tests/target/type_alias.rs @@ -49,3 +49,7 @@ pub type Exactly101CharstoEqualWhereTest where T: Clone + Ord + Eq + SomeOtherTrait = Option; + +type RegisterPlugin = unsafe fn(pt: *const c_char, + plugin: *mut c_void, + data: *mut CallbackData);