summary refs log tree commit diff
path: root/src/libsyntax/ast_util.rs
diff options
context:
space:
mode:
authorPiotr Jawniak <sawyer47@gmail.com>2014-06-26 08:15:14 +0200
committerPiotr Jawniak <sawyer47@gmail.com>2014-06-26 08:56:49 +0200
commitf8e06c49650afd7c9ef749baa72cb8da59880f96 (patch)
tree5d9325ebd7357f26b59ee719b7b8be2d39e43c1d /src/libsyntax/ast_util.rs
parent99519cc8e645dd50522c2f32cf55ef8c15583012 (diff)
downloadrust-f8e06c49650afd7c9ef749baa72cb8da59880f96.tar.gz
rust-f8e06c49650afd7c9ef749baa72cb8da59880f96.zip
Remove unnecessary to_string calls
This commit removes superfluous to_string calls from various places
Diffstat (limited to 'src/libsyntax/ast_util.rs')
-rw-r--r--src/libsyntax/ast_util.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs
index df8cb328270..2a6f7bdb87e 100644
--- a/src/libsyntax/ast_util.rs
+++ b/src/libsyntax/ast_util.rs
@@ -30,7 +30,7 @@ pub fn path_name_i(idents: &[Ident]) -> String {
     // FIXME: Bad copies (#2543 -- same for everything else that says "bad")
     idents.iter().map(|i| {
         token::get_ident(*i).get().to_string()
-    }).collect::<Vec<String>>().connect("::").to_string()
+    }).collect::<Vec<String>>().connect("::")
 }
 
 // totally scary function: ignores all but the last element, should have
@@ -123,7 +123,7 @@ pub fn int_ty_to_str(t: IntTy, val: Option<i64>) -> String {
         // cast to a u64 so we can correctly print INT64_MIN. All integral types
         // are parsed as u64, so we wouldn't want to print an extra negative
         // sign.
-        Some(n) => format!("{}{}", n as u64, s).to_string(),
+        Some(n) => format!("{}{}", n as u64, s),
         None => s.to_string()
     }
 }
@@ -150,7 +150,7 @@ pub fn uint_ty_to_str(t: UintTy, val: Option<u64>) -> String {
     };
 
     match val {
-        Some(n) => format!("{}{}", n, s).to_string(),
+        Some(n) => format!("{}{}", n, s),
         None => s.to_string()
     }
 }