Skip to content

Commit

Permalink
Remove unnecessary RefCell for doc_strings
Browse files Browse the repository at this point in the history
This was there for `Divider` and is no longer necessary.
  • Loading branch information
jyn514 committed Oct 12, 2020
1 parent 1772f2d commit 4187828
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustdoc/clean/types.rs
Expand Up @@ -533,7 +533,7 @@ impl Attributes {
attrs: &[ast::Attribute],
additional_attrs: Option<(&[ast::Attribute], DefId)>,
) -> Attributes {
let doc_strings = RefCell::new(vec![]);
let mut doc_strings = vec![];
let mut sp = None;
let mut cfg = Cfg::True;
let mut doc_line = 0;
Expand All @@ -550,7 +550,7 @@ impl Attributes {

let line = doc_line;
doc_line += value.lines().count();
doc_strings.borrow_mut().push(DocFragment {
doc_strings.push(DocFragment {
line,
span: attr.span,
doc: value,
Expand All @@ -575,7 +575,7 @@ impl Attributes {
{
let line = doc_line;
doc_line += contents.lines().count();
doc_strings.borrow_mut().push(DocFragment {
doc_strings.push(DocFragment {
line,
span: attr.span,
doc: contents,
Expand Down Expand Up @@ -621,7 +621,7 @@ impl Attributes {
.map_or(true, |a| a.style == AttrStyle::Inner);

Attributes {
doc_strings: doc_strings.into_inner(),
doc_strings,
other_attrs,
cfg: if cfg == Cfg::True { None } else { Some(Arc::new(cfg)) },
span: sp,
Expand Down

0 comments on commit 4187828

Please sign in to comment.