Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lcheylus
Copy link
Contributor

@lcheylus lcheylus commented Nov 8, 2025

After merge of PR #9158, there is a warning on OpenBSD with clippy:

(...)
  error: this could be rewritten as `let...else`
     --> src/uucore/src/lib/features/uptime.rs:216:5
      |
  216 | /     let entries = match parse_from_path(file) {
  217 | |         Ok(e) => e,
  218 | |         Err(_) => return 0,
  219 | |     };
      | |______^ help: consider writing: `let Ok(entries) = parse_from_path(file) else { return 0 };`
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
      = note: `-D clippy::manual-let-else` implied by `-D warnings`
      = help: to override `-D warnings` add `#[allow(clippy::manual_let_else)]`

In src/uucore/src/lib/features/uptime.rs, replace match parse_from_path(file) with a let..else expression to fix this warning.

Tests OK on OpenBSD/amd64 with Rust 1.90.0 for uptime:

$ cargo test -v --no-default-features --features uptime
(...)
running 7 tests
test test_uptime::test_uptime ... ok
test test_uptime::test_uptime_check_users_openbsd ... ok
test test_uptime::test_invalid_arg ... ok
test test_uptime::test_uptime_with_dir ... ok
test test_uptime::test_uptime_with_extra_argument ... ok
test test_uptime::test_uptime_with_non_existent_file ... ok
test test_uptime::test_uptime_since ... ok

test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s

@sylvestre sylvestre merged commit 6fa4ca9 into uutils:main Nov 8, 2025
115 of 116 checks passed
@lcheylus lcheylus deleted the openbsd-uptime branch November 8, 2025 17:14
@github-actions
Copy link

github-actions bot commented Nov 8, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants