From 80bc78de09c81085dd5851297267bd858b4687d5 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 23 Feb 2025 00:57:01 +1100 Subject: [PATCH] Fix fs-lock lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/fs-lock/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index 40087300..88d1cff7 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -3,7 +3,7 @@ //! These use the same mechanisms as, and are interoperable with, Cargo. use std::{ - fs::File. + fs::File, io::{self, IoSlice, IoSliceMut, SeekFrom}, ops, path::Path, }; @@ -19,10 +19,13 @@ pub struct FileLock( ); impl FileLock { + #[cfg(not(feature = "tracing"))] fn new(file: File) -> Self { - #[cfg(not(feature = "tracing"))] Self(file) - #[cfg(feature = "tracing")] + } + + #[cfg(feature = "tracing")] + fn new(file: File) -> Self { Self(file, None) }