mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-21 19:33:16 +00:00
Merge pull request #293 from sinhpham/small_style_fixes
Small style fixes.
This commit is contained in:
commit
6e4ea7842b
@ -20,5 +20,4 @@ regex = "0.1.41"
|
||||
|
||||
[dev-dependencies]
|
||||
diff = "0.1.0"
|
||||
regex = "0.1"
|
||||
term = "0.2"
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user