fix: do not check lock_task on iOS before syncing

`lock_task` is anyways always `None` on iOS
to avoid lock files held open and cause 0xdead10cc crashes.
This commit is contained in:
B. Petersen
2023-12-05 22:57:37 +01:00
committed by bjoern
parent 36c751bcc3
commit c784c499c2

View File

@@ -424,11 +424,13 @@ impl Config {
/// Takes a mutable reference because the saved file is a part of the `Config` state. This
/// protects from parallel calls resulting to a wrong file contents.
async fn sync(&mut self) -> Result<()> {
#[cfg(not(target_os = "ios"))]
ensure!(!self
.lock_task
.as_ref()
.context("Config is read-only")?
.is_finished());
let tmp_path = self.file.with_extension("toml.tmp");
let mut file = fs::File::create(&tmp_path)
.await