mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Better chat settings management
This commit is contained in:
parent
afb43d266e
commit
7929872091
3 changed files with 95 additions and 45 deletions
|
@ -123,6 +123,15 @@ impl<T> Setting<T> {
|
|||
*self = new;
|
||||
true
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn unwrap(self) -> T {
|
||||
match self {
|
||||
Setting::Set(value) => value,
|
||||
Setting::Reset => panic!("Setting::Reset unwrapped"),
|
||||
Setting::NotSet => panic!("Setting::NotSet unwrapped"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Serialize> Serialize for Setting<T> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue