diff options
| author | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-09-09 19:14:20 +0200 |
|---|---|---|
| committer | Marcus Klaas de Vries <mail@marcusklaas.nl> | 2015-09-09 19:14:20 +0200 |
| commit | 6e4ea7842b2e42099953fcba8f7b76c8626bdf4a (patch) | |
| tree | 6ace0f2086ceab6b2d4a3f945939395fbc1004b6 /src | |
| parent | aa2abc63a0adf69ce72ff25cba1fb384bfb73600 (diff) | |
| parent | e47646b44b6598dc8578bf9ede76893dbcc07ea9 (diff) | |
Merge pull request #293 from sinhpham/small_style_fixes
Small style fixes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/expr.rs | 2 | ||||
| -rw-r--r-- | src/string.rs | 9 |
2 files changed, 5 insertions, 6 deletions
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); |
