From: topecongiro Date: Thu, 23 Nov 2017 03:37:12 +0000 (+0900) Subject: Force vertical layout when we find any kind of single line comments X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=53d7489221e4d6fa25bf624b78a80608c27aedf5;p=rust.git Force vertical layout when we find any kind of single line comments --- diff --git a/src/lists.rs b/src/lists.rs index b80d8d6541e..1e073945c0b 100644 --- a/src/lists.rs +++ b/src/lists.rs @@ -137,10 +137,10 @@ pub fn is_multiline(&self) -> bool { pub fn has_comment(&self) -> bool { self.pre_comment .as_ref() - .map_or(false, |comment| comment.starts_with("//")) + .map_or(false, |comment| comment.trim_left().starts_with("//")) || self.post_comment .as_ref() - .map_or(false, |comment| comment.starts_with("//")) + .map_or(false, |comment| comment.trim_left().starts_with("//")) } pub fn from_str>(s: S) -> ListItem {