mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01: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 {
|
if let Setting::NotSet = new {
|
||||||
return;
|
return false;
|
||||||
|
}
|
||||||
|
if self == &new {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
*self = new;
|
*self = new;
|
||||||
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user