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