Merge branch 'main' into indexer-edition-2024

This commit is contained in:
Louis Dureuil 2024-11-20 16:59:58 +01:00
commit 6e6acfcf1b
No known key found for this signature in database
330 changed files with 10063 additions and 1499 deletions

View file

@ -96,6 +96,14 @@ impl<T> Setting<T> {
}
}
/// Returns other if self is not set.
pub fn or(self, other: Self) -> Self {
match self {
Setting::Set(_) | Setting::Reset => self,
Setting::NotSet => other,
}
}
/// Returns `true` if applying the new setting changed this setting
pub fn apply(&mut self, new: Self) -> bool
where