mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
Small style fixes.
This commit is contained in:
parent
aa2abc63a0
commit
e47646b44b
@ -20,5 +20,4 @@ regex = "0.1.41"
|
|||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
diff = "0.1.0"
|
diff = "0.1.0"
|
||||||
regex = "0.1"
|
|
||||||
term = "0.2"
|
term = "0.2"
|
||||||
|
@ -846,7 +846,7 @@ fn rewrite_string_lit(context: &RewriteContext,
|
|||||||
width: usize,
|
width: usize,
|
||||||
offset: usize)
|
offset: usize)
|
||||||
-> Option<String> {
|
-> Option<String> {
|
||||||
if context.config.format_strings == false {
|
if !context.config.format_strings {
|
||||||
return Some(context.snippet(span));
|
return Some(context.snippet(span));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,8 +10,6 @@
|
|||||||
|
|
||||||
// Format string literals.
|
// Format string literals.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use unicode_segmentation::UnicodeSegmentation;
|
use unicode_segmentation::UnicodeSegmentation;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
@ -74,10 +72,11 @@ pub fn rewrite_string<'a>(s: &str, fmt: &StringFormat<'a>) -> String {
|
|||||||
cur_end += 1;
|
cur_end += 1;
|
||||||
}
|
}
|
||||||
let raw_line = graphemes[cur_start..cur_end].join("");
|
let raw_line = graphemes[cur_start..cur_end].join("");
|
||||||
let line: &str = if fmt.trim_end {
|
let line = if fmt.trim_end {
|
||||||
&(raw_line.trim())
|
raw_line.trim()
|
||||||
} else {
|
} else {
|
||||||
&raw_line
|
// TODO: use as_str once it's stable.
|
||||||
|
&*raw_line
|
||||||
};
|
};
|
||||||
|
|
||||||
result.push_str(line);
|
result.push_str(line);
|
||||||
|
Loading…
Reference in New Issue
Block a user