diff options
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/introspect.rs | 4 | ||||
| -rw-r--r-- | src/model/styles.rs | 4 |
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)), }) } } |
