enable rust default option

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-11-17 18:52:27 +08:00
parent 7bb39f5607
commit 75d8168070
9 changed files with 162 additions and 82 deletions

View File

@@ -974,6 +974,8 @@ impl LoginConfigHandler {
self.save_config(config);
}
//to-do: too many dup code below.
/// Save view style to the current config.
///
/// # Arguments
@@ -985,13 +987,24 @@ impl LoginConfigHandler {
self.save_config(config);
}
/// Save scroll style to the current config.
///
/// # Arguments
///
/// * `value` - The view style to be saved.
pub fn save_scroll_style(&mut self, value: String) {
let mut config = self.load_config();
config.scroll_style = value;
self.save_config(config);
}
/// Set a ui config of flutter for handler's [`PeerConfig`].
///
/// # Arguments
///
/// * `k` - key of option
/// * `v` - value of option
pub fn set_ui_flutter(&mut self, k: String, v: String) {
pub fn save_ui_flutter(&mut self, k: String, v: String) {
let mut config = self.load_config();
config.ui_flutter.insert(k, v);
self.save_config(config);