about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc/back/link.rs12
-rw-r--r--src/libsyntax/parse/comments.rs6
2 files changed, 9 insertions, 9 deletions
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index bd9c7f1616d..02f1877e2f9 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -487,12 +487,12 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
     fn crate_meta_extras_hash(symbol_hasher: &hash::State,
                               -cmh_items: ~[@ast::meta_item],
                               dep_hashes: ~[~str]) -> @str {
-        fn len_and_str(s: ~str) -> ~str {
-            return fmt!("%u_%s", str::len(s), s);
+        fn len_and_str(s: &str) -> ~str {
+            fmt!("%u_%s", s.len(), s)
         }
 
         fn len_and_str_lit(l: ast::lit) -> ~str {
-            return len_and_str(pprust::lit_to_str(@l));
+            len_and_str(pprust::lit_to_str(@l))
         }
 
         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 {
 
 // Name sanitation. LLVM will happily accept identifiers with weird names, but
 // gas doesn't!
-pub fn sanitize(s: ~str) -> ~str {
+pub fn sanitize(s: &str) -> ~str {
     let mut result = ~"";
     for str::chars_each(s) |c| {
         match c {
@@ -629,10 +629,10 @@ pub fn sanitize(s: ~str) -> ~str {
           'a' .. 'z'
           | 'A' .. 'Z'
           | '0' .. '9'
-          | '_' => str::push_char(&mut result, c),
+          | '_' => result.push_char(c),
           _ => {
             if c > 'z' && char::is_XID_continue(c) {
-                str::push_char(&mut result, c);
+                result.push_char(c);
             }
           }
         }
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index d58d894b6a0..e27784d1f6b 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -46,14 +46,14 @@ impl cmp::Eq for cmnt_style {
 
 pub type cmnt = {style: cmnt_style, lines: ~[~str], pos: BytePos};
 
-pub fn is_doc_comment(s: ~str) -> bool {
+pub fn is_doc_comment(s: &str) -> bool {
     (s.starts_with(~"///") && !is_line_non_doc_comment(s)) ||
     s.starts_with(~"//!") ||
     (s.starts_with(~"/**") && !is_block_non_doc_comment(s)) ||
     s.starts_with(~"/*!")
 }
 
-pub fn doc_comment_style(comment: ~str) -> ast::attr_style {
+pub fn doc_comment_style(comment: &str) -> ast::attr_style {
     assert is_doc_comment(comment);
     if comment.starts_with(~"//!") || comment.starts_with(~"/*!") {
         ast::attr_inner
@@ -62,7 +62,7 @@ pub fn doc_comment_style(comment: ~str) -> ast::attr_style {
     }
 }
 
-pub fn strip_doc_comment_decoration(comment: ~str) -> ~str {
+pub fn strip_doc_comment_decoration(comment: &str) -> ~str {
 
     /// remove whitespace-only lines from the start/end of lines
     fn vertical_trim(lines: ~[~str]) -> ~[~str] {