about summary refs log tree commit diff
path: root/src/string.rs
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 /src/string.rs
parentaa2abc63a0adf69ce72ff25cba1fb384bfb73600 (diff)
Small style fixes.
Diffstat (limited to 'src/string.rs')
-rw-r--r--src/string.rs9
1 files changed, 4 insertions, 5 deletions
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);