Small style fixes.

This commit is contained in:
Sinh Pham 2015-09-09 07:56:56 -04:00
parent aa2abc63a0
commit e47646b44b
3 changed files with 5 additions and 7 deletions

View File

@ -20,5 +20,4 @@ regex = "0.1.41"
[dev-dependencies]
diff = "0.1.0"
regex = "0.1"
term = "0.2"

View File

@ -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));
}

View File

@ -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);