Skip to content

Commit 208b237

Browse files
committedDec 3, 2024·
Apply clippy suggestions
Changes that weren't automatically applied via --fix. Signed-off-by: J Robert Ray <[email protected]>
1 parent ad67555 commit 208b237

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed
 

‎crates/spfs-cli/common/src/args.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,7 @@ impl Logging {
389389

390390
#[cfg(unix)]
391391
let syslog_layer = self.syslog.then(|| {
392-
let identity = std::ffi::CStr::from_bytes_with_nul(b"spfs\0")
393-
.expect("identity value is valid CStr");
392+
let identity = c"spfs";
394393
let (options, facility) = Default::default();
395394
let layer = fmt_layer().with_writer(
396395
syslog_tracing::Syslog::new(identity, options, facility)

‎crates/spfs-vfs/src/winfsp/mount.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ impl Mount {
167167
let Ok(relative) = path.strip_prefix(r"\\") else {
168168
return None;
169169
};
170-
let Some(str_path) = relative.to_str() else {
171-
return None;
172-
};
170+
let str_path = relative.to_str()?;
173171

174172
const TRIM_END: &[char] = &['/'];
175173
let path = str_path.replace('\\', "/");
@@ -183,15 +181,11 @@ impl Mount {
183181
return entry;
184182
}
185183
for step in path.split('/') {
186-
let Some(current) = entry.take() else {
187-
return None;
188-
};
184+
let current = entry.take()?;
189185
let EntryKind::Tree = current.kind else {
190186
return None;
191187
};
192-
let Some(child) = current.entries.get(step) else {
193-
return None;
194-
};
188+
let child = current.entries.get(step)?;
195189
entry = self
196190
.inodes
197191
.get(&child.user_data)

‎crates/spfs-vfs/src/winfsp/router.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,10 @@ pub fn get_parent_pids(root: Option<u32>) -> std::result::Result<Vec<u32>, winfs
557557
let no_more_files = HRESULT::from(ERROR_NO_MORE_FILES);
558558
let snapshot = unsafe { CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, child)? };
559559
let mut parents = HashMap::new();
560-
let mut process = PROCESSENTRY32::default();
561-
process.dwSize = std::mem::size_of::<PROCESSENTRY32>() as u32;
560+
let mut process = PROCESSENTRY32 {
561+
dwSize: std::mem::size_of::<PROCESSENTRY32>() as u32,
562+
..Default::default()
563+
};
562564
loop {
563565
match unsafe { Process32Next(snapshot, &mut process as *mut PROCESSENTRY32) } {
564566
Ok(()) => {

0 commit comments

Comments
 (0)
Please sign in to comment.