diff --git a/crates/disktree-app/src/state.rs b/crates/disktree-app/src/state.rs index 29c655c..a84bad3 100644 --- a/crates/disktree-app/src/state.rs +++ b/crates/disktree-app/src/state.rs @@ -222,14 +222,14 @@ mod ssh_hosts { pub fn default_path() -> Option { #[cfg(target_os = "macos")] { - return std::env::home_dir().map(|home| { + std::env::home_dir().map(|home| { home.join("Library/Application Support/disktree/ssh-hosts") - }); + }) } #[cfg(windows)] { - return std::env::var_os("APPDATA") - .map(|dir| PathBuf::from(dir).join("disktree/ssh-hosts")); + std::env::var_os("APPDATA") + .map(|dir| PathBuf::from(dir).join("disktree/ssh-hosts")) } #[cfg(not(any(target_os = "macos", windows)))] { diff --git a/crates/disktree-cli/tests/stdio.rs b/crates/disktree-cli/tests/stdio.rs index 7abeff2..b012d22 100644 --- a/crates/disktree-cli/tests/stdio.rs +++ b/crates/disktree-cli/tests/stdio.rs @@ -140,14 +140,19 @@ fn memory_and_core_limits_are_installed_before_reading_a_request() { let limits = std::fs::read_to_string(format!("/proc/{}/limits", helper.0.id())) .unwrap(); - if limits.lines().any(|line| { + let as_ready = limits.lines().any(|line| { line.starts_with("Max address space") && line .split_whitespace() .nth(3) .and_then(|value| value.parse::().ok()) .is_some_and(|value| value <= 32 << 30) - }) { + }); + let core_ready = limits.lines().any(|line| { + line.starts_with("Max core file size") + && line.split_whitespace().nth(4) == Some("0") + }); + if as_ready && core_ready { break limits; } assert!(std::time::Instant::now() < deadline); diff --git a/crates/disktree-core/src/access.rs b/crates/disktree-core/src/access.rs index a33025d..35d55ef 100644 --- a/crates/disktree-core/src/access.rs +++ b/crates/disktree-core/src/access.rs @@ -73,7 +73,9 @@ pub const fn file_table_readable(root: &Path) -> bool { /// UAC prompt. An error if the prompt is declined, or off Windows. pub fn restart_as_administrator(args: &[OsString]) -> io::Result<()> { #[cfg(windows)] - return crate::windows::run_elevated(&std::env::current_exe()?, args); + { + crate::windows::run_elevated(&std::env::current_exe()?, args) + } #[cfg(not(windows))] { let _ = args; diff --git a/crates/disktree-core/src/error_log.rs b/crates/disktree-core/src/error_log.rs index 9afcef5..cd4ff43 100644 --- a/crates/disktree-core/src/error_log.rs +++ b/crates/disktree-core/src/error_log.rs @@ -17,13 +17,12 @@ const MAX_LOG_BYTES: u64 = 2 * 1024 * 1024; pub fn default_path() -> Option { #[cfg(target_os = "macos")] { - return std::env::home_dir() - .map(|h| h.join("Library/Logs/disktree/errors.log")); + std::env::home_dir().map(|h| h.join("Library/Logs/disktree/errors.log")) } #[cfg(windows)] { - return std::env::var_os("LOCALAPPDATA") - .map(|d| PathBuf::from(d).join("disktree/errors.log")); + std::env::var_os("LOCALAPPDATA") + .map(|d| PathBuf::from(d).join("disktree/errors.log")) } #[cfg(not(any(target_os = "macos", windows)))] { diff --git a/crates/disktree-scanner/src/mft.rs b/crates/disktree-scanner/src/mft.rs index f2725f5..154ea2d 100644 --- a/crates/disktree-scanner/src/mft.rs +++ b/crates/disktree-scanner/src/mft.rs @@ -1132,9 +1132,8 @@ impl Table<'_> { } self.child(entry, depth, descend).transpose() }; - const PARALLEL_LEVELS: usize = 3; let entries = self.entries(number); - let children = if depth < PARALLEL_LEVELS { + let children = if depth < 3 { entries .par_iter() .filter_map(child)