mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
Fix toggle encryption
Open the config file in write mode so the toggle encryption button is actually working
This commit is contained in:
@@ -138,7 +138,7 @@ pub fn write_file(path: String, contents: String) {
|
|||||||
let path_buf = std::path::PathBuf::from(&path);
|
let path_buf = std::path::PathBuf::from(&path);
|
||||||
|
|
||||||
// Create file if it exists, otherwise just open and rewrite
|
// 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::options().write(true).truncate(true).open(&path_buf) {
|
||||||
Ok(file) => file,
|
Ok(file) => file,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("Failed to open file: {}", e);
|
println!("Failed to open file: {}", e);
|
||||||
@@ -162,4 +162,4 @@ pub fn write_file(path: String, contents: String) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user