@@ -51,8 +51,8 @@ fn fold_nmod(
51
51
}
52
52
53
53
fn build_mod_index (
54
- doc : doc:: ModDoc ,
55
- config : config:: Config
54
+ + doc : doc:: ModDoc ,
55
+ + config : config:: Config
56
56
) -> doc:: Index {
57
57
{
58
58
entries: par:: map ( doc. items , |doc| {
@@ -62,8 +62,8 @@ fn build_mod_index(
62
62
}
63
63
64
64
fn build_nmod_index (
65
- doc : doc:: NmodDoc ,
66
- config : config:: Config
65
+ + doc : doc:: NmodDoc ,
66
+ + config : config:: Config
67
67
) -> doc:: Index {
68
68
{
69
69
entries: par:: map ( doc. fns , |doc| {
@@ -73,8 +73,8 @@ fn build_nmod_index(
73
73
}
74
74
75
75
fn item_to_entry(
76
- doc : doc:: ItemTag ,
77
- config : config:: Config
76
+ + doc : doc:: ItemTag ,
77
+ + config : config:: Config
78
78
) -> doc:: IndexEntry {
79
79
let link = match doc {
80
80
doc:: ModTag ( _) | doc:: NmodTag ( _)
@@ -94,7 +94,7 @@ fn item_to_entry(
94
94
}
95
95
}
96
96
97
- fn pandoc_header_id(header: ~ str) -> ~str {
97
+ fn pandoc_header_id(header: & str) -> ~str {
98
98
99
99
// http://johnmacfarlane.net/pandoc/README.html#headers
100
100
@@ -106,10 +106,10 @@ fn pandoc_header_id(header: ~str) -> ~str {
106
106
let header = maybe_use_section_id(header);
107
107
return header;
108
108
109
- fn remove_formatting(s: ~ str) -> ~str {
109
+ fn remove_formatting(s: & str) -> ~str {
110
110
str::replace(s, ~" `", ~"")
111
111
}
112
- fn remove_punctuation( s: ~ str) -> ~str {
112
+ fn remove_punctuation( s: & str) -> ~str {
113
113
let s = str:: replace( s, ~"<", ~"") ;
114
114
let s = str:: replace( s, ~">", ~"") ;
115
115
let s = str:: replace( s, ~"[ ", ~" ") ;
@@ -124,17 +124,17 @@ fn pandoc_header_id(header: ~str) -> ~str {
124
124
let s = str:: replace( s, ~"^", ~"") ;
125
125
return s;
126
126
}
127
- fn replace_with_hyphens( s: ~ str) -> ~str {
127
+ fn replace_with_hyphens( s: & str) -> ~str {
128
128
// Collapse sequences of whitespace to a single dash
129
129
// XXX: Hacky implementation here that only covers
130
130
// one or two spaces.
131
131
let s = str:: replace( s, ~" ", ~" -") ;
132
132
let s = str:: replace( s, ~" ", ~" -") ;
133
133
return s;
134
134
}
135
- fn convert_to_lowercase( s: ~ str) -> ~str { str:: to_lower( s) }
136
- fn remove_up_to_first_letter( s: ~ str) -> ~str { s }
137
- fn maybe_use_section_id( s: ~ str) -> ~str { s }
135
+ fn convert_to_lowercase( s: & str) -> ~str { str:: to_lower( s) }
136
+ fn remove_up_to_first_letter( s: & str) -> ~str { s. to_str ( ) }
137
+ fn maybe_use_section_id( s: & str) -> ~str { s. to_str ( ) }
138
138
}
139
139
140
140
#[ test]
@@ -232,7 +232,7 @@ fn should_index_foreign_mod_contents() {
232
232
#[cfg(test)]
233
233
mod test {
234
234
#[legacy_exports];
235
- fn mk_doc(output_style: config::OutputStyle, source: ~str) -> doc::Doc {
235
+ fn mk_doc(output_style: config::OutputStyle, + source: ~str) -> doc::Doc {
236
236
do astsrv::from_str(source) |srv| {
237
237
let config = {
238
238
output_style: output_style,
0 commit comments