summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorMarek Barvíř <barvirm@gmail.com>2023-03-28 09:38:01 +0200
committerGitHub <noreply@github.com>2023-03-28 09:38:01 +0200
commit213f31c5d71b3a5676ec8cce58204b1ac7f2cdea (patch)
treebb0730bbc768f80eb3995b3a55d12a0f62ab3ee8 /src/model
parentdfbd3503d9a03215238ade30726651b09d6fab2d (diff)
Fix basic lints (cargo clippy) (#383)
Diffstat (limited to 'src/model')
-rw-r--r--src/model/introspect.rs4
-rw-r--r--src/model/styles.rs4
2 files changed, 4 insertions, 4 deletions
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<u128>,
checkpoints: Vec<usize>,
@@ -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<T: Element>(&self) -> Option<Option<Span>> {
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)),
})
}
}