mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
Change Setting::apply function signature
This commit is contained in:
parent
de2ca7006e
commit
e249e4db7b
@ -78,11 +78,19 @@ impl<T> Setting<T> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn apply(&mut self, new: Self) {
|
||||
/// Returns `true` if applying the new setting changed this setting
|
||||
pub fn apply(&mut self, new: Self) -> bool
|
||||
where
|
||||
T: PartialEq + Eq,
|
||||
{
|
||||
if let Setting::NotSet = new {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if self == &new {
|
||||
return false;
|
||||
}
|
||||
*self = new;
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user