Skip to content

Commit ba49597

Browse files
committed
chore: address clippy lints
1 parent 4b4cbc4 commit ba49597

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

.cspell.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: "0.2"
22
words:
33
- clippy
44
- direnv
5+
- msrv
6+
- nextest
57
- nixos
68
- nixpkgs
79
- pkgs

src/implementation/codegen.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,23 +180,17 @@ pub(crate) fn generate(
180180
};
181181

182182
if mode == ContractMode::LogOnly {
183-
result.extend(
184-
quote::quote_spanned! { span=>
185-
if !(#exec_expr) {
186-
log::error!("{}", #format_args);
187-
}
183+
result.extend(quote::quote_spanned! { span=>
184+
if !(#exec_expr) {
185+
log::error!("{}", #format_args);
188186
}
189-
.into_iter(),
190-
);
187+
});
191188
}
192189

193190
if let Some(assert_macro) = get_assert_macro(ctype, mode, span) {
194-
result.extend(
195-
quote::quote_spanned! { span=>
196-
#assert_macro!(#exec_expr, "{}", #format_args);
197-
}
198-
.into_iter(),
199-
);
191+
result.extend(quote::quote_spanned! { span=>
192+
#assert_macro!(#exec_expr, "{}", #format_args);
193+
});
200194
}
201195

202196
if mode == ContractMode::Test {

src/implementation/traits.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,9 @@ pub(crate) fn contract_trait_item_trait(_attrs: TokenStream, mut trait_: ItemTra
181181
.collect::<Vec<_>>();
182182

183183
// remove all previous methods
184-
trait_.items = trait_
184+
trait_
185185
.items
186-
.into_iter()
187-
.filter(|item| !matches!(item, TraitItem::Method(_)))
188-
.collect();
186+
.retain(|item| !matches!(item, TraitItem::Method(_)));
189187

190188
// add back new methods
191189
trait_.items.extend(funcs);

0 commit comments

Comments
 (0)