diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2024-07-18 15:41:57 +0200 |
---|---|---|
committer | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2024-07-18 15:59:37 +0200 |
commit | c8d10ea69e26c8ba6d58155d321348fa90e84ecd (patch) | |
tree | 8517f80837d783b17d27e53f5b9bfe8faf241cfb | |
parent | 42b3baf32fe003280f26d46af9ef4bdf443e04e3 (diff) |
clippy: simplify code according to nightly 'manual_unwrap_or_default' lint
https://rust-lang.github.io/rust-clippy/master/index.html#/manual_unwrap_or_default
-rw-r--r-- | tests/by-util/test_pinky.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/by-util/test_pinky.rs b/tests/by-util/test_pinky.rs index 93f265cc7..f061d55df 100644 --- a/tests/by-util/test_pinky.rs +++ b/tests/by-util/test_pinky.rs @@ -54,10 +54,7 @@ fn test_long_format_multiple_users() { // multiple instances of one account we know exists, // the account of the test runner, // and an account that (probably) doesn't exist - let runner = match std::env::var("USER") { - Ok(user) => user, - Err(_) => String::new(), - }; + let runner = std::env::var("USER").unwrap_or_default(); let args = ["-l", "root", "root", "root", &runner, "no_such_user"]; let ts = TestScenario::new(util_name!()); let expect = unwrap_or_return!(expected_result(&ts, &args)); |