Skip to content

Commit 681e5be

Browse files
committed
rustdoc: Remove a pointer that's no longer needed
1 parent fdea1c4 commit 681e5be

File tree

9 files changed

+24
-25
lines changed

9 files changed

+24
-25
lines changed

src/rustdoc/doc.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ type itemdoc = {
3131

3232
type moddoc = {
3333
item: itemdoc,
34-
// This box exists to break the structural recursion
35-
items: ~[itemtag]
34+
items: [itemtag]
3635
};
3736

3837
type nmoddoc = {
@@ -112,7 +111,7 @@ type tydoc = {
112111
impl util for moddoc {
113112

114113
fn mods() -> [moddoc] {
115-
vec::filter_map(*self.items) {|itemtag|
114+
vec::filter_map(self.items) {|itemtag|
116115
alt itemtag {
117116
modtag(moddoc) { some(moddoc) }
118117
_ { none }
@@ -121,7 +120,7 @@ impl util for moddoc {
121120
}
122121

123122
fn nmods() -> [nmoddoc] {
124-
vec::filter_map(*self.items) {|itemtag|
123+
vec::filter_map(self.items) {|itemtag|
125124
alt itemtag {
126125
nmodtag(nmoddoc) { some(nmoddoc) }
127126
_ { none }
@@ -130,7 +129,7 @@ impl util for moddoc {
130129
}
131130

132131
fn fns() -> [fndoc] {
133-
vec::filter_map(*self.items) {|itemtag|
132+
vec::filter_map(self.items) {|itemtag|
134133
alt itemtag {
135134
fntag(fndoc) { some(fndoc) }
136135
_ { none }
@@ -139,7 +138,7 @@ impl util for moddoc {
139138
}
140139

141140
fn consts() -> [constdoc] {
142-
vec::filter_map(*self.items) {|itemtag|
141+
vec::filter_map(self.items) {|itemtag|
143142
alt itemtag {
144143
consttag(constdoc) { some(constdoc) }
145144
_ { none }
@@ -148,7 +147,7 @@ impl util for moddoc {
148147
}
149148

150149
fn enums() -> [enumdoc] {
151-
vec::filter_map(*self.items) {|itemtag|
150+
vec::filter_map(self.items) {|itemtag|
152151
alt itemtag {
153152
enumtag(enumdoc) { some(enumdoc) }
154153
_ { none }
@@ -157,7 +156,7 @@ impl util for moddoc {
157156
}
158157

159158
fn resources() -> [resdoc] {
160-
vec::filter_map(*self.items) {|itemtag|
159+
vec::filter_map(self.items) {|itemtag|
161160
alt itemtag {
162161
restag(resdoc) { some(resdoc) }
163162
_ { none }
@@ -166,7 +165,7 @@ impl util for moddoc {
166165
}
167166

168167
fn ifaces() -> [ifacedoc] {
169-
vec::filter_map(*self.items) {|itemtag|
168+
vec::filter_map(self.items) {|itemtag|
170169
alt itemtag {
171170
ifacetag(ifacedoc) { some(ifacedoc) }
172171
_ { none }
@@ -175,7 +174,7 @@ impl util for moddoc {
175174
}
176175

177176
fn impls() -> [impldoc] {
178-
vec::filter_map(*self.items) {|itemtag|
177+
vec::filter_map(self.items) {|itemtag|
179178
alt itemtag {
180179
impltag(impldoc) { some(impldoc) }
181180
_ { none }
@@ -184,7 +183,7 @@ impl util for moddoc {
184183
}
185184

186185
fn types() -> [tydoc] {
187-
vec::filter_map(*self.items) {|itemtag|
186+
vec::filter_map(self.items) {|itemtag|
188187
alt itemtag {
189188
tytag(tydoc) { some(tydoc) }
190189
_ { none }

src/rustdoc/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn moddoc_from_mod(
4949
) -> doc::moddoc {
5050
{
5151
item: itemdoc,
52-
items: ~vec::filter_map(module.items) {|item|
52+
items: vec::filter_map(module.items) {|item|
5353
let itemdoc = mk_itemdoc(item.id, item.ident);
5454
alt item.node {
5555
ast::item_mod(m) {

src/rustdoc/fold.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn default_seq_fold_mod<T>(
141141
) -> doc::moddoc {
142142
{
143143
item: fold.fold_item(fold, doc.item),
144-
items: ~vec::map(*doc.items) {|itemtag|
144+
items: vec::map(doc.items) {|itemtag|
145145
fold_itemtag(fold, itemtag)
146146
}
147147
with doc
@@ -167,7 +167,7 @@ fn default_par_fold_mod<T:send>(
167167
) -> doc::moddoc {
168168
{
169169
item: fold.fold_item(fold, doc.item),
170-
items: ~util::parmap(*doc.items) {|itemtag|
170+
items: util::parmap(doc.items) {|itemtag|
171171
fold_itemtag(fold, itemtag)
172172
}
173173
with doc

src/rustdoc/markdown_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn write_mod_contents(
130130
write_brief(ctxt, doc.brief());
131131
write_desc(ctxt, doc.desc());
132132

133-
for itemtag in *doc.items {
133+
for itemtag in doc.items {
134134
alt itemtag {
135135
doc::modtag(moddoc) { write_mod(ctxt, moddoc) }
136136
doc::nmodtag(_) { fail }
@@ -229,7 +229,7 @@ fn should_correctly_indent_fn_signature() {
229229
let doc = test::create_doc("fn a() { }");
230230
let doc = {
231231
topmod: {
232-
items: ~[doc::fntag({
232+
items: [doc::fntag({
233233
sig: some("line 1\nline 2")
234234
with doc.topmod.fns()[0]
235235
})]

src/rustdoc/prune_undoc_items_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn fold_mod(
3636
doc: doc::moddoc
3737
) -> doc::moddoc {
3838
let doc = {
39-
items: ~vec::filter_map(*doc.items) {|itemtag|
39+
items: vec::filter_map(doc.items) {|itemtag|
4040
alt itemtag {
4141
doc::modtag(moddoc) {
4242
let doc = fold.fold_mod(fold, moddoc);
@@ -110,7 +110,7 @@ fn fold_mod(
110110
fold.ctxt.have_docs =
111111
doc.brief() != none
112112
|| doc.desc() != none
113-
|| vec::is_not_empty(*doc.items);
113+
|| vec::is_not_empty(doc.items);
114114
ret doc;
115115
}
116116

src/rustdoc/prune_unexported_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn run(srv: astsrv::srv, doc: doc::cratedoc) -> doc::cratedoc {
2121
fn fold_mod(fold: fold::fold<astsrv::srv>, doc: doc::moddoc) -> doc::moddoc {
2222
let doc = fold::default_any_fold_mod(fold, doc);
2323
{
24-
items: ~exported_items(fold.ctxt, doc)
24+
items: exported_items(fold.ctxt, doc)
2525
with doc
2626
}
2727
}
@@ -66,7 +66,7 @@ fn exported_items_from(
6666
doc: doc::moddoc,
6767
is_exported: fn(astsrv::srv, str) -> bool
6868
) -> [doc::itemtag] {
69-
vec::filter_map(*doc.items) { |itemtag|
69+
vec::filter_map(doc.items) { |itemtag|
7070
let itemtag = alt itemtag {
7171
doc::enumtag(enumdoc) {
7272
// Also need to check variant exportedness

src/rustdoc/reexport_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ fn build_reexport_def_map(
115115
fn fold_mod(fold: fold::fold<ctxt>, doc: doc::moddoc) -> doc::moddoc {
116116
let doc = fold::default_seq_fold_mod(fold, doc);
117117

118-
for item in *doc.items {
118+
for item in doc.items {
119119
let def_id = ast_util::local_def(item.id());
120120
if fold.ctxt.def_set.contains_key(def_id) {
121121
fold.ctxt.def_map.insert(def_id, item);
@@ -201,7 +201,7 @@ fn merge_reexports(
201201
#debug("merging into %?: %?", path, new_items);
202202

203203
{
204-
items: ~(*doc.items + new_items)
204+
items: (doc.items + new_items)
205205
with doc
206206
}
207207
}

src/rustdoc/rustdoc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn test_run_passes() {
5252
name: doc.topmod.name() + "two"
5353
with doc.topmod.item
5454
},
55-
items: ~[]
55+
items: []
5656
}
5757
}
5858
}
@@ -66,7 +66,7 @@ fn test_run_passes() {
6666
name: doc.topmod.name() + "three"
6767
with doc.topmod.item
6868
},
69-
items: ~[]
69+
items: []
7070
}
7171
}
7272
}

src/rustdoc/sort_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn fold_mod(
3030
) -> doc::moddoc {
3131
let doc = fold::default_any_fold_mod(fold, doc);
3232
{
33-
items: ~sort::merge_sort(fold.ctxt, *doc.items)
33+
items: sort::merge_sort(fold.ctxt, doc.items)
3434
with doc
3535
}
3636
}

0 commit comments

Comments
 (0)