diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-05 12:53:39 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-05 12:53:39 -0600 |
commit | 2f31215c0b4d7f8dbec94747a4f134d8eee70c44 (patch) | |
tree | 3c87bebd15287d559053173942b35b188c3ed49e /src/args.rs | |
parent | 0539e82bab014b24b956752cc4301b1cba8edc0f (diff) | |
download | makers-2f31215c0b4d7f8dbec94747a4f134d8eee70c44.tar.gz makers-2f31215c0b4d7f8dbec94747a4f134d8eee70c44.zip |
don't use &String where it makes a mess
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/args.rs b/src/args.rs index 4f36c03..6a46986 100644 --- a/src/args.rs +++ b/src/args.rs @@ -172,12 +172,18 @@ impl Args { Self::from_given_args_and_given_env(args.into_iter(), env_makeflags) } - pub fn targets(&self) -> impl Iterator<Item = &String> { - self.targets_or_macros.iter().filter(|x| !x.contains('=')) + pub fn targets(&self) -> impl Iterator<Item = &str> { + self.targets_or_macros + .iter() + .map(AsRef::as_ref) + .filter(|x: &&str| !x.contains('=')) } - pub fn macros(&self) -> impl Iterator<Item = &String> { - self.targets_or_macros.iter().filter(|x| x.contains('=')) + pub fn macros(&self) -> impl Iterator<Item = &str> { + self.targets_or_macros + .iter() + .map(AsRef::as_ref) + .filter(|x: &&str| x.contains('=')) } } |