diff --git a/crates/subspace-farmer/src/single_disk_farm.rs b/crates/subspace-farmer/src/single_disk_farm.rs index 4f22220089..6354c29bf8 100644 --- a/crates/subspace-farmer/src/single_disk_farm.rs +++ b/crates/subspace-farmer/src/single_disk_farm.rs @@ -91,17 +91,7 @@ impl SingleDiskFarmId { /// Exclusive lock for single disk farm info file, ensuring no concurrent edits by cooperating processes is done #[must_use = "Lock file must be kept around or as long as farm is used"] pub struct SingleDiskFarmInfoLock { - file: File, -} - -impl Drop for SingleDiskFarmInfoLock { - fn drop(&mut self) { - use fs4::FileExt; - - if let Err(error) = self.file.unlock() { - error!(%error, "Failed to unlock single disk farm lock"); - } - } + _file: File, } /// Important information about the contents of the `SingleDiskFarm` @@ -184,7 +174,7 @@ impl SingleDiskFarmInfo { let file = File::open(directory.join(Self::FILE_NAME))?; fs4::FileExt::try_lock_exclusive(&file)?; - Ok(SingleDiskFarmInfoLock { file }) + Ok(SingleDiskFarmInfoLock { _file: file }) } // ID of the farm