Skip to content

Commit adf8c0a

Browse files
committed
revert generating rw error when it's unused
1 parent d036a0a commit adf8c0a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/items.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1917,10 +1917,9 @@ pub(crate) fn rewrite_struct_field(
19171917

19181918
let orig_ty = shape
19191919
.offset_left(overhead + spacing.len())
1920-
.unknown_error()
1921-
.and_then(|ty_shape| field.ty.rewrite_result(context, ty_shape));
1920+
.and_then(|ty_shape| field.ty.rewrite_result(context, ty_shape).ok());
19221921

1923-
if let Ok(ref ty) = orig_ty {
1922+
if let Some(ref ty) = orig_ty {
19241923
if !ty.contains('\n') && !contains_comment(context.snippet(missing_span)) {
19251924
return Ok(attr_prefix + &spacing + ty);
19261925
}

0 commit comments

Comments
 (0)