mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Merge pull request #1431 from topecongiro/fix-1428
Check existence of pre comment explicitly
This commit is contained in:
commit
e94a97d9a1
@ -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
|
||||
|
@ -178,3 +178,5 @@ struct Deep {
|
||||
Type,
|
||||
NodeType>,
|
||||
}
|
||||
|
||||
struct Foo<C=()>(String);
|
||||
|
@ -182,3 +182,5 @@ struct Deep {
|
||||
deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
|
||||
node::Handle<IdRef<'id, Node<Key, Value>>, Type, NodeType>,
|
||||
}
|
||||
|
||||
struct Foo<C = ()>(String);
|
||||
|
Loading…
Reference in New Issue
Block a user