Skip to content

Commit

Permalink
chore: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhelvetican committed Oct 4, 2024
1 parent a042cf5 commit 59d0482
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/utils/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl Config {
return File::options()
.read(true)
.create(true)
.truncate(true)
.truncate(false)
.write(true)
.open(path);
}
Expand All @@ -80,6 +80,8 @@ impl Config {
}

pub fn default_path() -> String {
// TODO: REPLACE the .unwrap() calls with .unwrap_or(DEFAULT_VALUE)

#[cfg(target_os = "windows")]
let path = format!(
"{}{}\\Pictures\\Capter",
Expand All @@ -96,7 +98,7 @@ impl Config {
DirBuilder::new()
.recursive(true)
.create(Path::new(&path))
.unwrap();
.expect("error creating directory.");

path
}
Expand Down
2 changes: 1 addition & 1 deletion src/windows/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl ConfigureWindow {
ConfigEvent::OpenFolder => Task::done(AppEvent::OpenDirectory),
ConfigEvent::UpdateTheme(event) => {
self.theme.update(event);
().into()
Task::none()
}
ConfigEvent::RequestExit => Task::done(AppEvent::ExitApp),
}
Expand Down

0 comments on commit 59d0482

Please sign in to comment.