fix(settings): use localization

This commit is contained in:
Fernando López Guevara
2025-07-29 21:21:06 -03:00
parent 5848f1c355
commit be720c0f76
4 changed files with 66 additions and 51 deletions

View File

@@ -159,9 +159,7 @@ impl Notedeck {
1024usize * 1024usize * 1024usize * 1024usize
};
let mut settings_handler = SettingsHandler::new(&path);
settings_handler.load();
let settings_handler = SettingsHandler::new(&path).load();
let config = Config::new().set_ingester_threads(2).set_mapsize(map_size);

View File

@@ -84,9 +84,9 @@ impl SettingsHandler {
}
}
pub fn load(&mut self) {
pub fn load(mut self) -> Self {
if self.migrate_to_settings_file().is_ok() {
return;
return self;
}
match self.directory.get_file(SETTINGS_FILE.to_string()) {
@@ -107,6 +107,8 @@ impl SettingsHandler {
self.current_settings = Some(Settings::default());
}
}
self
}
pub fn save(&self) {