Skip to content

Commit 43032c0

Browse files
committed
Apply clippy suggestions
1 parent ad69bd3 commit 43032c0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

enumflags/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,10 +409,10 @@ mod impl_serde {
409409
fn deserialize<D: serde::Deserializer<'a>>(d: D) -> Result<Self, D::Error> {
410410
let val = T::Type::deserialize(d)?;
411411
Self::from_bits(val)
412-
.or_else(|_| Err(D::Error::invalid_value(
412+
.map_err(|_| D::Error::invalid_value(
413413
Unexpected::Unsigned(val.into()),
414414
&"valid bit representation"
415-
)))
415+
))
416416
}
417417
}
418418

enumflags_derive/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ fn fold_expr(expr: &syn::Expr) -> Result<u64, EvaluationError> {
7070
match expr_lit.lit {
7171
syn::Lit::Int(ref lit_int) => {
7272
lit_int.base10_parse()
73-
.or_else(|_| Err(LiteralOutOfRange(expr.span())))
73+
.map_err(|_| LiteralOutOfRange(expr.span()))
7474
}
7575
_ => Err(UnsupportedOperation(expr.span()))
7676
}

0 commit comments

Comments
 (0)