mirror of
https://github.com/tobi/disktree.git
synced 2026-11-29 08:00:52 +00:00
fix(ci): clear macOS/Windows needless-return & mft lints and wait for both RLIMIT_AS + RLIMIT_CORE in stdio test
This commit is contained in:
@@ -222,14 +222,14 @@ mod ssh_hosts {
|
||||
pub fn default_path() -> Option<PathBuf> {
|
||||
#[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)))]
|
||||
{
|
||||
|
||||
@@ -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::<u64>().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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -17,13 +17,12 @@ const MAX_LOG_BYTES: u64 = 2 * 1024 * 1024;
|
||||
pub fn default_path() -> Option<PathBuf> {
|
||||
#[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)))]
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user