mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 15:16:37 +00:00
Fix fs-lock lib.rs
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
090884a70f
commit
80bc78de09
1 changed files with 6 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
//! These use the same mechanisms as, and are interoperable with, Cargo.
|
//! These use the same mechanisms as, and are interoperable with, Cargo.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File.
|
fs::File,
|
||||||
io::{self, IoSlice, IoSliceMut, SeekFrom},
|
io::{self, IoSlice, IoSliceMut, SeekFrom},
|
||||||
ops, path::Path,
|
ops, path::Path,
|
||||||
};
|
};
|
||||||
|
@ -19,10 +19,13 @@ pub struct FileLock(
|
||||||
);
|
);
|
||||||
|
|
||||||
impl FileLock {
|
impl FileLock {
|
||||||
|
#[cfg(not(feature = "tracing"))]
|
||||||
fn new(file: File) -> Self {
|
fn new(file: File) -> Self {
|
||||||
#[cfg(not(feature = "tracing"))]
|
|
||||||
Self(file)
|
Self(file)
|
||||||
#[cfg(feature = "tracing")]
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "tracing")]
|
||||||
|
fn new(file: File) -> Self {
|
||||||
Self(file, None)
|
Self(file, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue