about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSinh Pham <phamansinh@gmail.com>2015-09-09 07:56:56 -0400
committerSinh Pham <phamansinh@gmail.com>2015-09-09 07:56:56 -0400
commite47646b44b6598dc8578bf9ede76893dbcc07ea9 (patch)
tree6ace0f2086ceab6b2d4a3f945939395fbc1004b6
parentaa2abc63a0adf69ce72ff25cba1fb384bfb73600 (diff)
Small style fixes.
-rw-r--r--Cargo.toml1
-rw-r--r--src/expr.rs2
-rw-r--r--src/string.rs9
3 files changed, 5 insertions, 7 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 377c88a955b..597eb8f942d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,5 +20,4 @@ regex = "0.1.41"
 
 [dev-dependencies]
 diff = "0.1.0"
-regex = "0.1"
 term = "0.2"
diff --git a/src/expr.rs b/src/expr.rs
index ab20dc1738d..e641d7c6762 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -846,7 +846,7 @@ fn rewrite_string_lit(context: &RewriteContext,
                       width: usize,
                       offset: usize)
                       -> Option<String> {
-    if context.config.format_strings == false {
+    if !context.config.format_strings {
         return Some(context.snippet(span));
     }
 
diff --git a/src/string.rs b/src/string.rs
index ba93b2db81d..aba6a7f48da 100644
--- a/src/string.rs
+++ b/src/string.rs
@@ -10,8 +10,6 @@
 
 // Format string literals.
 
-
-
 use unicode_segmentation::UnicodeSegmentation;
 use regex::Regex;
 
@@ -74,10 +72,11 @@ pub fn rewrite_string<'a>(s: &str, fmt: &StringFormat<'a>) -> String {
             cur_end += 1;
         }
         let raw_line = graphemes[cur_start..cur_end].join("");
-        let line: &str = if fmt.trim_end {
-            &(raw_line.trim())
+        let line = if fmt.trim_end {
+            raw_line.trim()
         } else {
-            &raw_line
+            // TODO: use as_str once it's stable.
+            &*raw_line
         };
 
         result.push_str(line);