Skip to content

Commit 4187828

Browse files
committedOct 12, 2020
Remove unnecessary RefCell for doc_strings
This was there for `Divider` and is no longer necessary.
1 parent 1772f2d commit 4187828

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/librustdoc/clean/types.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ impl Attributes {
533533
attrs: &[ast::Attribute],
534534
additional_attrs: Option<(&[ast::Attribute], DefId)>,
535535
) -> Attributes {
536-
let doc_strings = RefCell::new(vec![]);
536+
let mut doc_strings = vec![];
537537
let mut sp = None;
538538
let mut cfg = Cfg::True;
539539
let mut doc_line = 0;
@@ -550,7 +550,7 @@ impl Attributes {
550550

551551
let line = doc_line;
552552
doc_line += value.lines().count();
553-
doc_strings.borrow_mut().push(DocFragment {
553+
doc_strings.push(DocFragment {
554554
line,
555555
span: attr.span,
556556
doc: value,
@@ -575,7 +575,7 @@ impl Attributes {
575575
{
576576
let line = doc_line;
577577
doc_line += contents.lines().count();
578-
doc_strings.borrow_mut().push(DocFragment {
578+
doc_strings.push(DocFragment {
579579
line,
580580
span: attr.span,
581581
doc: contents,
@@ -621,7 +621,7 @@ impl Attributes {
621621
.map_or(true, |a| a.style == AttrStyle::Inner);
622622

623623
Attributes {
624-
doc_strings: doc_strings.into_inner(),
624+
doc_strings,
625625
other_attrs,
626626
cfg: if cfg == Cfg::True { None } else { Some(Arc::new(cfg)) },
627627
span: sp,

0 commit comments

Comments
 (0)
Please sign in to comment.