Skip to content

Commit

Permalink
fix: satisfy clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Zak <[email protected]>
  • Loading branch information
rjzak committed Feb 17, 2024
1 parent d69cefd commit fb5bd9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions ciborium/src/value/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,8 @@ impl<'a, 'de> de::Deserializer<'de> for Deserializer<&'a Value> {
visitor.visit_u64(x)
} else if let Ok(x) = i64::try_from(*x) {
visitor.visit_i64(x)
} else if let Ok(x) = i128::try_from(*x) {
visitor.visit_i128(x)
} else {
unreachable!()
visitor.visit_i128(i128::from(*x))
}
}

Expand Down
4 changes: 1 addition & 3 deletions ciborium/src/value/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ impl ser::Serialize for Value {
serializer.serialize_i64(x)
} else if let Ok(x) = u128::try_from(*x) {
serializer.serialize_u128(x)
} else if let Ok(x) = i128::try_from(*x) {
serializer.serialize_i128(x)
} else {
unreachable!()
serializer.serialize_i128(i128::from(*x))
}
}

Expand Down

0 comments on commit fb5bd9f

Please sign in to comment.