fix: add truncate(true) to lock file OpenOptions for clippy compliance
Resolves clippy::suspicious_open_options warning on whitelist lock file creation.
This commit is contained in:
@ -138,6 +138,7 @@ impl WhitelistManager {
|
|||||||
let lock_path = format!("{}.lock", self.config_path);
|
let lock_path = format!("{}.lock", self.config_path);
|
||||||
let lock_file = OpenOptions::new()
|
let lock_file = OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
|
.truncate(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
.open(&lock_path)
|
.open(&lock_path)
|
||||||
.with_context(|| format!("Failed to create lock file: {}", lock_path))?;
|
.with_context(|| format!("Failed to create lock file: {}", lock_path))?;
|
||||||
|
|||||||
Reference in New Issue
Block a user