summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2015-01-19 11:07:13 -0500
committerJorge Aparicio <japaricious@gmail.com>2015-01-19 12:24:43 -0500
commit49684850bedcef007a2949c97872606d1d6dc325 (patch)
tree3842f94c466f1466a391cfa344cc448998984f1a /src/libsyntax
parent43f2c199e4e87d7ccd15658c52ad8dc5a1d54fb9 (diff)
downloadrust-49684850bedcef007a2949c97872606d1d6dc325.tar.gz
rust-49684850bedcef007a2949c97872606d1d6dc325.zip
remove unnecessary parentheses from range notation
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast_map/mod.rs2
-rw-r--r--src/libsyntax/diagnostic.rs2
-rw-r--r--src/libsyntax/parse/lexer/comments.rs4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs
index f462a730d3a..baa9516ae5d 100644
--- a/src/libsyntax/ast_map/mod.rs
+++ b/src/libsyntax/ast_map/mod.rs
@@ -525,7 +525,7 @@ impl<'ast> Map<'ast> {
         NodesMatchingSuffix {
             map: self,
             item_name: parts.last().unwrap(),
-            in_which: &parts[..(parts.len() - 1)],
+            in_which: &parts[..parts.len() - 1],
             idx: 0,
         }
     }
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs
index 7213b0fa955..745343ade63 100644
--- a/src/libsyntax/diagnostic.rs
+++ b/src/libsyntax/diagnostic.rs
@@ -280,7 +280,7 @@ fn print_maybe_styled(w: &mut EmitterWriter,
             // to be miscolored. We assume this is rare enough that we don't
             // have to worry about it.
             if msg.ends_with("\n") {
-                try!(t.write_str(&msg[..(msg.len()-1)]));
+                try!(t.write_str(&msg[..msg.len()-1]));
                 try!(t.reset());
                 try!(t.write_str("\n"));
             } else {
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index 16ade904be8..79a85e9afbd 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -116,7 +116,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String {
 
         if can_trim {
             lines.iter().map(|line| {
-                (&line[(i + 1)..line.len()]).to_string()
+                (&line[i + 1..line.len()]).to_string()
             }).collect()
         } else {
             lines
@@ -132,7 +132,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String {
     }
 
     if comment.starts_with("/*") {
-        let lines = comment[3u..(comment.len() - 2u)]
+        let lines = comment[3u..comment.len() - 2u]
             .lines_any()
             .map(|s| s.to_string())
             .collect::<Vec<String> >();