From 1f1f7214caaae9221e15dbfddeb65e31a94dda73 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Sat, 18 Dec 2021 11:32:40 -0600 Subject: [PATCH] Remove unnecessary `need_backline` function --- src/librustdoc/clean/types.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 6ce6d88915010..214ede89a01b1 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1033,12 +1033,6 @@ impl Attributes { ) -> Attributes { let mut doc_strings: Vec = vec![]; - fn update_need_backline(doc_strings: &mut Vec) { - if let Some(prev) = doc_strings.last_mut() { - prev.need_backline = true; - } - } - let clean_attr = |(attr, parent_module): (&ast::Attribute, Option)| { if let Some(value) = attr.doc_str() { trace!("got doc_str={:?}", value); @@ -1058,7 +1052,9 @@ impl Attributes { indent: 0, }; - update_need_backline(&mut doc_strings); + if let Some(prev) = doc_strings.last_mut() { + prev.need_backline = true; + } doc_strings.push(frag);