mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
pop before trimming
This commit is contained in:
parent
9ac6125e1d
commit
0ea449597e
1 changed files with 6 additions and 8 deletions
|
@ -550,15 +550,13 @@ fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[
|
|||
suspicious_doc_comments::check(cx, attrs);
|
||||
|
||||
let (fragments, _) = attrs_to_doc_fragments(attrs.iter().map(|attr| (attr, None)), true);
|
||||
let mut doc = fragments
|
||||
.iter()
|
||||
.fold(String::new(), |mut acc, fragment| {
|
||||
add_doc_fragment(&mut acc, fragment);
|
||||
acc
|
||||
})
|
||||
.trim()
|
||||
.to_string();
|
||||
let mut doc = fragments.iter().fold(String::new(), |mut acc, fragment| {
|
||||
add_doc_fragment(&mut acc, fragment);
|
||||
acc
|
||||
});
|
||||
doc.pop();
|
||||
let doc = doc.trim().to_string();
|
||||
|
||||
if doc.is_empty() {
|
||||
return Some(DocInfo {
|
||||
empty: true,
|
||||
|
|
Loading…
Reference in a new issue