From 039f1a09f9019537996ebbc0c548574dbc4fc185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Wed, 10 Jan 2024 16:06:24 +0200 Subject: [PATCH] ci: fix clippy --- borsh-derive/src/internals/deserialize/structs/mod.rs | 2 +- borsh/src/schema/container_ext/max_size.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/borsh-derive/src/internals/deserialize/structs/mod.rs b/borsh-derive/src/internals/deserialize/structs/mod.rs index 61b11bf0b..837a38a11 100644 --- a/borsh-derive/src/internals/deserialize/structs/mod.rs +++ b/borsh-derive/src/internals/deserialize/structs/mod.rs @@ -22,7 +22,7 @@ pub fn process(input: &ItemStruct, cratename: Path) -> syn::Result } } Fields::Unnamed(fields) => { - for (_field_idx, field) in fields.unnamed.iter().enumerate() { + for field in fields.unnamed.iter() { deserialize::process_field(field, &cratename, &mut body, &mut generics_output)?; } quote! { diff --git a/borsh/src/schema/container_ext/max_size.rs b/borsh/src/schema/container_ext/max_size.rs index 782955a87..a6bebb793 100644 --- a/borsh/src/schema/container_ext/max_size.rs +++ b/borsh/src/schema/container_ext/max_size.rs @@ -103,9 +103,7 @@ fn max_serialized_size_impl<'a>( Ok(Definition::Primitive(size)) => match size { 0 => Ok(0), size => { - let count_sizes = usize::try_from(*size) - .ok() - .and_then(|size| size.checked_mul(count.get())); + let count_sizes = usize::from(*size).checked_mul(count.get()); count_sizes.ok_or(Error::Overflow) } },