@@ -70,12 +70,12 @@ pub fn get_crate_data(cstore: @mut CStore, cnum: ast::crate_num)
70
70
71
71
pub fn get_crate_hash ( cstore : @mut CStore , cnum : ast:: crate_num ) -> ~str {
72
72
let cdata = get_crate_data ( cstore, cnum) ;
73
- return decoder:: get_crate_hash ( cdata. data ) ;
73
+ decoder:: get_crate_hash ( cdata. data )
74
74
}
75
75
76
76
pub fn get_crate_vers ( cstore : @mut CStore , cnum : ast:: crate_num ) -> ~str {
77
77
let cdata = get_crate_data ( cstore, cnum) ;
78
- return decoder:: get_crate_vers ( cdata. data ) ;
78
+ decoder:: get_crate_vers ( cdata. data )
79
79
}
80
80
81
81
pub fn set_crate_data ( cstore : @mut CStore ,
@@ -110,21 +110,21 @@ pub fn get_used_crate_files(cstore: @mut CStore) -> ~[Path] {
110
110
pub fn add_used_library ( cstore : @mut CStore , +lib : ~str ) -> bool {
111
111
assert lib != ~"";
112
112
113
- if vec :: contains ( cstore. used_libraries , & lib) { return false ; }
113
+ if cstore. used_libraries . contains ( & lib) { return false ; }
114
114
cstore. used_libraries . push ( lib) ;
115
- return true ;
115
+ true
116
116
}
117
117
118
118
pub fn get_used_libraries ( cstore : @mut CStore ) -> ~[ ~str ] {
119
- return /*bad*/ copy cstore. used_libraries ;
119
+ /*bad*/ copy cstore. used_libraries
120
120
}
121
121
122
122
pub fn add_used_link_args ( cstore : @mut CStore , args : & str ) {
123
- cstore. used_link_args . push_all ( str :: split_char ( args , ' ' ) ) ;
123
+ cstore. used_link_args . push_all ( args . split_char ( ' ' ) ) ;
124
124
}
125
125
126
126
pub fn get_used_link_args ( cstore : @mut CStore ) -> ~[ ~str ] {
127
- return /*bad*/ copy cstore. used_link_args ;
127
+ /*bad*/ copy cstore. used_link_args
128
128
}
129
129
130
130
pub fn add_extern_mod_stmt_cnum ( cstore : @mut CStore ,
@@ -155,21 +155,14 @@ pub fn get_dep_hashes(cstore: @mut CStore) -> ~[~str] {
155
155
result. push ( { name: /*bad*/ copy cdata. name , hash: hash} ) ;
156
156
}
157
157
158
- pure fn lteq ( a : & crate_hash , b : & crate_hash ) -> bool {
159
- a. name <= b. name
160
- }
158
+ let sorted = std:: sort:: merge_sort ( result, |a, b| a. name <= b. name ) ;
161
159
162
- let sorted = std:: sort:: merge_sort ( result, lteq) ;
163
160
debug ! ( "sorted:" ) ;
164
161
for sorted. each |x| {
165
162
debug ! ( " hash[%s]: %s" , x. name, x. hash) ;
166
163
}
167
164
168
- fn mapper ( ch : & crate_hash ) -> ~str {
169
- return /*bad*/ copy ch. hash ;
170
- }
171
-
172
- return vec:: map ( sorted, mapper) ;
165
+ sorted. map ( |ch| /*bad*/ copy ch. hash )
173
166
}
174
167
175
168
// Local Variables:
0 commit comments