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 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
|
|
||||||
|
use rustc_span::symbol::kw;
|
||||||
|
|
||||||
use crate::clean::{self, DocFragment, DocFragmentKind, Item};
|
use crate::clean::{self, DocFragment, DocFragmentKind, Item};
|
||||||
use crate::core::DocContext;
|
use crate::core::DocContext;
|
||||||
use crate::fold::{self, DocFolder};
|
use crate::fold::{self, DocFolder};
|
||||||
|
@ -87,7 +89,7 @@ fn unindent_fragments(docs: &mut Vec<DocFragment>) {
|
||||||
};
|
};
|
||||||
|
|
||||||
for fragment in docs {
|
for fragment in docs {
|
||||||
if fragment.doc.as_str().lines().next().is_none() {
|
if fragment.doc == kw::Empty {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue