Skip to content

Commit

Permalink
revert generating rw error when it's unused
Browse files Browse the repository at this point in the history
  • Loading branch information
ding-young committed Jun 27, 2024
1 parent d036a0a commit adf8c0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1917,10 +1917,9 @@ pub(crate) fn rewrite_struct_field(

let orig_ty = shape
.offset_left(overhead + spacing.len())
.unknown_error()
.and_then(|ty_shape| field.ty.rewrite_result(context, ty_shape));
.and_then(|ty_shape| field.ty.rewrite_result(context, ty_shape).ok());

if let Ok(ref ty) = orig_ty {
if let Some(ref ty) = orig_ty {
if !ty.contains('\n') && !contains_comment(context.snippet(missing_span)) {
return Ok(attr_prefix + &spacing + ty);
}
Expand Down

0 comments on commit adf8c0a

Please sign in to comment.