pop before trimming

This commit is contained in:
lucarlig 2024-02-25 17:23:15 +04:00
parent 9ac6125e1d
commit 0ea449597e

View File

@ -550,15 +550,13 @@ fn check_attrs(cx: &LateContext<'_>, valid_idents: &FxHashSet<String>, attrs: &[
suspicious_doc_comments::check(cx, attrs); suspicious_doc_comments::check(cx, attrs);
let (fragments, _) = attrs_to_doc_fragments(attrs.iter().map(|attr| (attr, None)), true); let (fragments, _) = attrs_to_doc_fragments(attrs.iter().map(|attr| (attr, None)), true);
let mut doc = fragments let mut doc = fragments.iter().fold(String::new(), |mut acc, fragment| {
.iter() add_doc_fragment(&mut acc, fragment);
.fold(String::new(), |mut acc, fragment| { acc
add_doc_fragment(&mut acc, fragment); });
acc
})
.trim()
.to_string();
doc.pop(); doc.pop();
let doc = doc.trim().to_string();
if doc.is_empty() { if doc.is_empty() {
return Some(DocInfo { return Some(DocInfo {
empty: true, empty: true,