From 574d29445199e12e4d1474b3cafe0fa5605a84cf Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 27 Mar 2021 17:10:04 -0600 Subject: appease clippy in makers::args --- src/args.rs | 11 ++++++----- src/main.rs | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/args.rs b/src/args.rs index ae58ce2..f96cba4 100644 --- a/src/args.rs +++ b/src/args.rs @@ -7,6 +7,7 @@ use structopt::StructOpt; #[derive(StructOpt, Debug, PartialEq, Eq, Clone)] #[structopt(author, about)] +#[allow(clippy::struct_excessive_bools)] pub(crate) struct Args { /// Cause environment variables, including those with null values, to override macro /// assignments within makefiles. @@ -127,7 +128,7 @@ impl Args { fn from_given_args_and_given_env( mut args: impl Iterator, env_makeflags: String, - ) -> Args { + ) -> Self { // POSIX spec says "Any options specified in the MAKEFLAGS environment variable // shall be evaluated before any options specified on the make utility command // line." @@ -149,16 +150,16 @@ impl Args { let env_makeflags = env_makeflags.split_whitespace().map(OsString::from); // per the structopt docs, the first argument will be used as the binary name, // so we need to make sure it goes in before MAKEFLAGS - let arg0 = args.next().unwrap_or_else(|| env!("CARGO_PKG_NAME").into()); + let arg_0 = args.next().unwrap_or_else(|| env!("CARGO_PKG_NAME").into()); - let args = iter::once(arg0) + let args = iter::once(arg_0) .chain(env_makeflags.into_iter()) .chain(args); - Args::from_iter(args) + Self::from_iter(args) } - pub(crate) fn from_env_and_args() -> Args { + pub(crate) fn from_env_and_args() -> Self { let env_makeflags = env::var("MAKEFLAGS").unwrap_or_default(); let args = env::args_os(); Self::from_given_args_and_given_env(args, env_makeflags) diff --git a/src/main.rs b/src/main.rs index 40303d3..0720ada 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ clippy::cargo, clippy::nursery )] +#![allow(clippy::redundant_pub_crate)] use std::fs::metadata; use std::io::stdin; -- cgit v1.2.3