Use fast comparison against kw::Empty
We think `.as_str().lines().next().is_none()` should be equivalent to `== kw::Empty`. Co-authored-by: Joshua Nelson <github@jyn.dev>
This commit is contained in:
parent
a792234388
commit
7a4e2ceb92
@ -1,5 +1,7 @@
|
||||
use std::cmp;
|
||||
|
||||
use rustc_span::symbol::kw;
|
||||
|
||||
use crate::clean::{self, DocFragment, DocFragmentKind, Item};
|
||||
use crate::core::DocContext;
|
||||
use crate::fold::{self, DocFolder};
|
||||
@ -87,7 +89,7 @@ fn unindent_fragments(docs: &mut Vec<DocFragment>) {
|
||||
};
|
||||
|
||||
for fragment in docs {
|
||||
if fragment.doc.as_str().lines().next().is_none() {
|
||||
if fragment.doc == kw::Empty {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user