Remove unnecessary RefCell for doc_strings

This was there for `Divider` and is no longer necessary.
This commit is contained in:
Joshua Nelson 2020-10-11 20:31:00 -04:00
parent 1772f2d2dc
commit 41878285e8

View File

@ -533,7 +533,7 @@ impl Attributes {
attrs: &[ast::Attribute], attrs: &[ast::Attribute],
additional_attrs: Option<(&[ast::Attribute], DefId)>, additional_attrs: Option<(&[ast::Attribute], DefId)>,
) -> Attributes { ) -> Attributes {
let doc_strings = RefCell::new(vec![]); let mut doc_strings = vec![];
let mut sp = None; let mut sp = None;
let mut cfg = Cfg::True; let mut cfg = Cfg::True;
let mut doc_line = 0; let mut doc_line = 0;
@ -550,7 +550,7 @@ impl Attributes {
let line = doc_line; let line = doc_line;
doc_line += value.lines().count(); doc_line += value.lines().count();
doc_strings.borrow_mut().push(DocFragment { doc_strings.push(DocFragment {
line, line,
span: attr.span, span: attr.span,
doc: value, doc: value,
@ -575,7 +575,7 @@ impl Attributes {
{ {
let line = doc_line; let line = doc_line;
doc_line += contents.lines().count(); doc_line += contents.lines().count();
doc_strings.borrow_mut().push(DocFragment { doc_strings.push(DocFragment {
line, line,
span: attr.span, span: attr.span,
doc: contents, doc: contents,
@ -621,7 +621,7 @@ impl Attributes {
.map_or(true, |a| a.style == AttrStyle::Inner); .map_or(true, |a| a.style == AttrStyle::Inner);
Attributes { Attributes {
doc_strings: doc_strings.into_inner(), doc_strings,
other_attrs, other_attrs,
cfg: if cfg == Cfg::True { None } else { Some(Arc::new(cfg)) }, cfg: if cfg == Cfg::True { None } else { Some(Arc::new(cfg)) },
span: sp, span: sp,