Skip to content

Commit 1f8d3ae

Browse files
committed
fix: allow unsafe_code for VolumeHandle Send+Sync impls
Add #[allow(unsafe_code)] to the Send+Sync impls since the project has -D unsafe-code. Also fix unnecessary qualification warnings.
1 parent f3f13b9 commit 1f8d3ae

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/uffs-cli/src/commands.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub async fn search(
7474
pattern: &str,
7575
single_drive: Option<char>,
7676
multi_drives: Option<Vec<char>>,
77-
index: Option<std::path::PathBuf>,
77+
index: Option<PathBuf>,
7878
files_only: bool,
7979
dirs_only: bool,
8080
min_size: Option<u64>,
@@ -141,7 +141,7 @@ pub async fn search(
141141
/// This prevents OOM errors when searching many drives with millions of files.
142142
#[allow(clippy::single_call_fn)] // Extracted to reduce search() line count below clippy::too_many_lines limit
143143
async fn load_and_filter_data(
144-
index: Option<std::path::PathBuf>,
144+
index: Option<PathBuf>,
145145
multi_drives: Option<Vec<char>>,
146146
single_drive: Option<char>,
147147
filters: &QueryFilters<'_>,
@@ -856,7 +856,7 @@ pub fn info(path: &Path) -> Result<()> {
856856
/// Statistics extracted from an index file.
857857
struct IndexStats {
858858
/// Absolute path to the index file.
859-
abs_path: std::path::PathBuf,
859+
abs_path: PathBuf,
860860
/// Size of the index file on disk in bytes.
861861
file_size: u64,
862862
/// Total number of records in the index.

crates/uffs-mft/src/platform.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ pub struct VolumeHandle {
5555
// to a kernel object that the OS manages. Multiple threads can safely read
5656
// from the same handle (though we don't do that - each task has its own
5757
// handle). This is required for tokio::spawn to work with MftReader.
58+
#[allow(unsafe_code)]
5859
unsafe impl Send for VolumeHandle {}
60+
#[allow(unsafe_code)]
5961
unsafe impl Sync for VolumeHandle {}
6062

6163
/// NTFS volume data retrieved from `FSCTL_GET_NTFS_VOLUME_DATA`.

0 commit comments

Comments
 (0)