1
Fork 0

Make rewrite_string return Option<String>

This commit is contained in:
Marcus Klaas 2015-09-25 12:53:25 +02:00
parent e80080deb6
commit a7690cb1e5
5 changed files with 129 additions and 88 deletions

View file

@ -407,11 +407,12 @@ impl<'a> Rewrite for [ast::Attribute] {
let multi_line = a_str.starts_with("//") && comment.matches('\n').count() > 1;
let comment = comment.trim();
if !comment.is_empty() {
let comment = rewrite_comment(comment,
false,
context.config.max_width - offset.width(),
offset,
context.config);
let comment = try_opt!(rewrite_comment(comment,
false,
context.config.max_width -
offset.width(),
offset,
context.config));
result.push_str(&indent);
result.push_str(&comment);
result.push('\n');