Merge pull request #35 from ffauzan/patch-1

Fix toggle encryption
This commit is contained in:
SpikeHD 2022-07-19 09:11:59 -07:00 committed by GitHub
commit 6ff1ef932c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,19 +138,11 @@ pub fn write_file(path: String, contents: String) {
let path_buf = std::path::PathBuf::from(&path);
// Create file if it exists, otherwise just open and rewrite
let mut file = match fs::File::open(&path_buf) {
let mut file = match fs::File::create(&path_buf) {
Ok(file) => file,
Err(e) => {
println!("Failed to open file: {}", e);
// attempt to create file. otherwise return
match fs::File::create(&path_buf) {
Ok(file) => file,
Err(e) => {
println!("Failed to create file: {}", e);
return;
}
}
return;
}
};