fix clippy suggestions
This commit is contained in:
@@ -31,7 +31,7 @@ impl AppState {
|
||||
currentlyEditing: None,
|
||||
screen: CurrentScreen::Main,
|
||||
entries: settings.entries,
|
||||
confDir: confDir,
|
||||
confDir,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,7 @@ impl Settings {
|
||||
pub fn new(config: &String) -> Self {
|
||||
let data = std::fs::read_to_string(config);
|
||||
match data {
|
||||
Ok(data) => {
|
||||
let settings =
|
||||
serde_json::from_str::<Settings>(&data).expect("Settings file corrupted");
|
||||
settings
|
||||
}
|
||||
Ok(data) => serde_json::from_str::<Settings>(&data).expect("Settings file corrupted"),
|
||||
Err(_) => {
|
||||
let newSet = Settings { entries: vec![] };
|
||||
let payload = serde_json::to_string_pretty(&newSet).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user