mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
removed unused max_width argument of rewrite_string function
This commit is contained in:
parent
472a2ed0f6
commit
86018133a0
@ -438,7 +438,7 @@ fn rewrite_comment_inner(
|
||||
}
|
||||
|
||||
if config.wrap_comments() && line.len() > fmt.shape.width && !has_url(line) {
|
||||
match rewrite_string(line, &fmt, Some(max_chars)) {
|
||||
match rewrite_string(line, &fmt) {
|
||||
Some(ref s) => {
|
||||
is_prev_line_multi_line = s.contains('\n');
|
||||
result.push_str(s);
|
||||
@ -449,7 +449,7 @@ fn rewrite_comment_inner(
|
||||
result.pop();
|
||||
result.push_str(&comment_line_separator);
|
||||
fmt.shape = Shape::legacy(max_chars, fmt_indent);
|
||||
match rewrite_string(line, &fmt, Some(max_chars)) {
|
||||
match rewrite_string(line, &fmt) {
|
||||
Some(ref s) => {
|
||||
is_prev_line_multi_line = s.contains('\n');
|
||||
result.push_str(s);
|
||||
|
@ -1229,7 +1229,6 @@ fn rewrite_string_lit(context: &RewriteContext, span: Span, shape: Shape) -> Opt
|
||||
rewrite_string(
|
||||
str_lit,
|
||||
&StringFormat::new(shape.visual_indent(0), context.config),
|
||||
None,
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ impl<'a> StringFormat<'a> {
|
||||
self.shape
|
||||
.width
|
||||
.checked_sub(self.opener.len() + self.line_end.len() + 1)?
|
||||
+ 1;
|
||||
+ 1,
|
||||
)
|
||||
}
|
||||
|
||||
@ -63,11 +63,7 @@ impl<'a> StringFormat<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn rewrite_string<'a>(
|
||||
orig: &str,
|
||||
fmt: &StringFormat<'a>,
|
||||
max_width: Option<usize>,
|
||||
) -> Option<String> {
|
||||
pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String> {
|
||||
let max_chars_with_indent = fmt.max_chars_with_indent()?;
|
||||
let max_chars_without_indent = fmt.max_chars_without_indent()?;
|
||||
let indent = fmt.shape.indent.to_string_with_newline(fmt.config);
|
||||
@ -235,7 +231,7 @@ mod test {
|
||||
fn issue343() {
|
||||
let config = Default::default();
|
||||
let fmt = StringFormat::new(Shape::legacy(2, Indent::empty()), &config);
|
||||
rewrite_string("eq_", &fmt, None);
|
||||
rewrite_string("eq_", &fmt);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user