Skip to content

Commit 2f73f71

Browse files
committed
fix: resolve CI failures for clippy and macOS uptime test
- Fix clippy::borrow-as-ptr lint error in parse_size.rs by using raw pointer syntax - Fix macOS uptime test regex to accept integer load averages without decimals Fixes OpenBSD and macOS CI test failures in PR uutils#9653
1 parent 10e7ea1 commit 2f73f71

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/uucore/src/lib/features/parser/parse_size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fn bsd_sysctl_memory(hw_constant: libc::c_int, sysctl_name: &str) -> Result<u128
108108
mib.as_mut_ptr(),
109109
2,
110110
ptr::from_mut(&mut size).cast::<libc::c_void>(),
111-
&mut len,
111+
&raw mut len,
112112
ptr::null_mut(),
113113
0,
114114
)

tests/by-util/test_uptime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ fn test_uptime_macos_output_format() {
338338
"Output should contain 'up': {stdout}"
339339
);
340340

341-
// Verify load average is present
342-
let load_re = Regex::new(r"load average: \d+\.\d+, \d+\.\d+, \d+\.\d+").unwrap();
341+
// Verify load average is present (decimal point is optional, e.g., "10" or "10.00")
342+
let load_re = Regex::new(r"load average: \d+(?:\.\d+)?, \d+(?:\.\d+)?, \d+(?:\.\d+)?").unwrap();
343343
assert!(
344344
load_re.is_match(stdout),
345345
"Output should contain load average: {stdout}"

0 commit comments

Comments
 (0)