Skip to content

fix clippy warning on non-linux systems #1455

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

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

syphar
Copy link
Member

@syphar syphar commented Jul 31, 2021

No description provided.

@syphar syphar added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jul 31, 2021
@@ -12,6 +12,7 @@ use crate::utils::{copy_dir_all, parse_rustc_version, CargoMetadata};
use crate::{db::blacklist::is_blacklisted, utils::MetadataPackage};
use crate::{Config, Context, Index, Metrics, Storage};
use docsrs_metadata::{Metadata, DEFAULT_TARGETS, HOST_TARGET};
#[cfg(target_os = "linux")]
use failure::ResultExt;
Copy link
Member Author

Choose a reason for hiding this comment

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

this is only used below in a section that is only compiled on linux, so this use is unused on all other platforms

Copy link
Member

Choose a reason for hiding this comment

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

Could you move it into the function that uses it instead? That way the cfgs are automatically in sync instead of needing to update them in two places.

Copy link
Member Author

Choose a reason for hiding this comment

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

I moved it into the block that uses it, not sure if that is the most idiomatic way :)

( I can move it to the function if that's what is better)

Copy link
Member

Choose a reason for hiding this comment

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

Yup, that's fine :) thanks!

@syphar syphar force-pushed the new-clippy-warnings branch from 507c69c to b00749f Compare July 31, 2021 20:10
@syphar syphar force-pushed the new-clippy-warnings branch from b00749f to f84fa01 Compare August 9, 2021 07:56
@syphar syphar changed the title fix new clippy warnings fix clippy warning on non-linux systems Aug 9, 2021
@syphar
Copy link
Member Author

syphar commented Aug 9, 2021

@jyn514 since @GuillaumeGomez fixed the clippy warnings in his own PR (#1457), I update this one to be only the non-linux warning.

@GuillaumeGomez
Copy link
Member

Thanks!

@GuillaumeGomez GuillaumeGomez merged commit a5a8cf2 into rust-lang:master Aug 9, 2021
@syphar syphar deleted the new-clippy-warnings branch August 9, 2021 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants