Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ding-young committed Jun 27, 2024
1 parent 72c2411 commit d036a0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,10 @@ impl Rewrite for ast::FnRetTy {
.checked_sub(arrow_width)
.max_width_error(shape.width, self.span())?;
return ty
.rewrite_result(context, Shape::legacy(inner_width, shape.indent + 3))
.rewrite_result(
context,
Shape::legacy(inner_width, shape.indent + arrow_width),
)
.map(|r| format!("-> {}", r));
}

Expand Down
2 changes: 1 addition & 1 deletion src/rewrite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) trait Rewrite {
fn rewrite(&self, context: &RewriteContext<'_>, shape: Shape) -> Option<String>;

fn rewrite_result(&self, context: &RewriteContext<'_>, shape: Shape) -> RewriteResult {
self.rewrite(context, shape).ok_or(RewriteError::Unknown)
self.rewrite(context, shape).unknown_error()
}
}

Expand Down

0 comments on commit d036a0a

Please sign in to comment.