mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 14:46:37 +00:00
Fix fs-lock impl
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
3e5f41e27e
commit
ce65159cc7
1 changed files with 5 additions and 6 deletions
|
@ -20,11 +20,10 @@ pub struct FileLock(
|
|||
|
||||
impl FileLock {
|
||||
fn new(file: File) -> Self {
|
||||
Self(
|
||||
file,
|
||||
#[cfg(feature = "tracing")]
|
||||
None,
|
||||
)
|
||||
#[cfg(not(feature = "tracing"))]
|
||||
Self(file)
|
||||
#[cfg(feature = "tracing")]
|
||||
Self(file, None)
|
||||
}
|
||||
|
||||
/// Take an exclusive lock on a [`File`].
|
||||
|
@ -33,7 +32,7 @@ impl FileLock {
|
|||
pub fn new_exclusive(file: File) -> io::Result<Self> {
|
||||
FileExt::lock_exclusive(&file)?;
|
||||
|
||||
Ok(Self:new(file))
|
||||
Ok(Self::new(file))
|
||||
}
|
||||
|
||||
/// Try to take an exclusive lock on a [`File`].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue