@@ -487,12 +487,12 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
487
487
fn crate_meta_extras_hash ( symbol_hasher : & hash:: State ,
488
488
-cmh_items : ~[ @ast:: meta_item ] ,
489
489
dep_hashes : ~[ ~str ] ) -> @str {
490
- fn len_and_str ( s : ~ str ) -> ~str {
491
- return fmt ! ( "%u_%s" , str :: len( s ) , s) ;
490
+ fn len_and_str ( s : & str ) -> ~str {
491
+ fmt ! ( "%u_%s" , s . len( ) , s)
492
492
}
493
493
494
494
fn len_and_str_lit ( l : ast:: lit ) -> ~str {
495
- return len_and_str ( pprust:: lit_to_str ( @l) ) ;
495
+ len_and_str ( pprust:: lit_to_str ( @l) )
496
496
}
497
497
498
498
let cmh_items = attr:: sort_meta_items ( cmh_items) ;
@@ -615,7 +615,7 @@ pub fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> @str {
615
615
616
616
// Name sanitation. LLVM will happily accept identifiers with weird names, but
617
617
// gas doesn't!
618
- pub fn sanitize(s: ~ str) -> ~str {
618
+ pub fn sanitize(s: & str) -> ~str {
619
619
let mut result = ~" ";
620
620
for str :: chars_each( s) |c| {
621
621
match c {
@@ -629,10 +629,10 @@ pub fn sanitize(s: ~str) -> ~str {
629
629
'a' .. 'z'
630
630
| 'A' .. 'Z'
631
631
| '0' .. '9'
632
- | '_' => str :: push_char ( & mut result , c) ,
632
+ | '_' => result . push_char ( c) ,
633
633
_ => {
634
634
if c > 'z' && char:: is_XID_continue ( c) {
635
- str :: push_char ( & mut result , c) ;
635
+ result . push_char ( c) ;
636
636
}
637
637
}
638
638
}
0 commit comments