Return None when a literal exceeds budget
This commit is contained in:
parent
00318c400b
commit
bdb8f369e8
@ -1691,7 +1691,7 @@ fn rewrite_pat_expr(
|
||||
pub fn rewrite_literal(context: &RewriteContext, l: &ast::Lit, shape: Shape) -> Option<String> {
|
||||
match l.node {
|
||||
ast::LitKind::Str(_, ast::StrStyle::Cooked) => rewrite_string_lit(context, l.span, shape),
|
||||
_ => Some(context.snippet(l.span)),
|
||||
_ => wrap_str(context.snippet(l.span), context.config.max_width(), shape),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user