Merge pull request #1431 from topecongiro/fix-1428

Check existence of pre comment explicitly
This commit is contained in:
Nick Cameron 2017-04-03 07:53:18 +12:00 committed by GitHub
commit e94a97d9a1
3 changed files with 7 additions and 1 deletions

View File

@ -350,7 +350,9 @@ impl<'a, T, I, F1, F2, F3> Iterator for ListItems<'a, I, F1, F2, F3>
.span_to_snippet(codemap::mk_sp(self.prev_span_end, (self.get_lo)(&item)))
.unwrap();
let trimmed_pre_snippet = pre_snippet.trim();
let pre_comment = if !trimmed_pre_snippet.is_empty() {
let has_pre_comment = trimmed_pre_snippet.contains("//") ||
trimmed_pre_snippet.contains("/*");
let pre_comment = if has_pre_comment {
Some(trimmed_pre_snippet.to_owned())
} else {
None

View File

@ -178,3 +178,5 @@ struct Deep {
Type,
NodeType>,
}
struct Foo<C=()>(String);

View File

@ -182,3 +182,5 @@ struct Deep {
deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
node::Handle<IdRef<'id, Node<Key, Value>>, Type, NodeType>,
}
struct Foo<C = ()>(String);