From 213f31c5d71b3a5676ec8cce58204b1ac7f2cdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barv=C3=AD=C5=99?= Date: Tue, 28 Mar 2023 09:38:01 +0200 Subject: Fix basic lints (cargo clippy) (#383) --- src/model/introspect.rs | 4 ++-- src/model/styles.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/model') diff --git a/src/model/introspect.rs b/src/model/introspect.rs index 2bd44ce1..f0ff1169 100644 --- a/src/model/introspect.rs +++ b/src/model/introspect.rs @@ -43,7 +43,7 @@ cast_from_value! { } /// Provides stable identities to elements. -#[derive(Clone)] +#[derive(Clone, Default)] pub struct StabilityProvider { hashes: Vec, checkpoints: Vec, @@ -52,7 +52,7 @@ pub struct StabilityProvider { impl StabilityProvider { /// Create a new stability provider. pub fn new() -> Self { - Self { hashes: vec![], checkpoints: vec![] } + Self::default() } } diff --git a/src/model/styles.rs b/src/model/styles.rs index db2b2053..82ec2ed5 100644 --- a/src/model/styles.rs +++ b/src/model/styles.rs @@ -71,8 +71,8 @@ impl Styles { pub fn interruption(&self) -> Option> { let func = T::func(); self.0.iter().find_map(|entry| match entry { - Style::Property(property) => property.is_of(func).then(|| property.span), - Style::Recipe(recipe) => recipe.is_of(func).then(|| Some(recipe.span)), + Style::Property(property) => property.is_of(func).then_some(property.span), + Style::Recipe(recipe) => recipe.is_of(func).then_some(Some(recipe.span)), }) } } -- cgit v1.2.3