Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address clippy issues #420

Closed
wants to merge 1 commit into from

Conversation

shutton
Copy link
Contributor

@shutton shutton commented Jan 11, 2022

We missed double-checking these in the prior merge. Not sure what we were smoking... 💨

@micahsnyder
Copy link
Contributor

Maybe we should make clippy a github action

@micahsnyder
Copy link
Contributor

Maybe we should make clippy a github action

Looks like the clippy-check action isn't active right now, possibly abandoned actions-rs/clippy-check#162

Copy link
Contributor

@micahsnyder micahsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some conflicts already. Needs to be rebased.

@micahsnyder
Copy link
Contributor

There are more, now. Oops.

clamav-micah-3 on  PR-420 [?] via △ v3.21.1 via 🦀 v1.58.0
❯ cargo clippy
   Compiling clamav_rust v0.0.1 (/home/micasnyd/workspace/clamav-micah-3/libclamav_rust)
warning: use of `unwrap_or` followed by a function call
  --> libclamav_rust/build.rs:97:43
   |
97 |     let cargo_cmd = env::var("CARGO_CMD").unwrap_or("".into());
   |                                           ^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| "".into())`
   |
   = note: `#[warn(clippy::or_fun_call)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call

warning: use of `unwrap_or` followed by a function call
   --> libclamav_rust/build.rs:109:59
    |
109 |         let maintainer_mode = env::var("MAINTAINER_MODE").unwrap_or("".into());
    |                                                           ^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| "".into())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call

warning: use of `unwrap_or` followed by a function call
   --> libclamav_rust/build.rs:122:64
    |
122 |     let build_dir = PathBuf::from(env::var("CARGO_TARGET_DIR").unwrap_or(".".into()));
    |                                                                ^^^^^^^^^^^^^^^^^^^^^ help: try this: `unwrap_or_else(|_| ".".into())`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call

warning: `clamav_rust` (build script) generated 3 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 5.84s

Copy link
Contributor

@micahsnyder micahsnyder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see these fixes plus the missing ones are all fixed in #421.

@micahsnyder
Copy link
Contributor

Will close because #421 includes all of these and more, and changes some of these to other things.

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