diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2024-04-25 00:32:14 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2024-04-25 00:32:14 +0200 |
| commit | 8394910a7a57f6ddecf055f37931b476b8d1742d (patch) | |
| tree | 4383502c5ec85e85517376e4397777a721a842ae /src/main.rs | |
| parent | 0f5874ea7c5b25152f448d8c46efee50b1c023ad (diff) | |
clippy: Follow most recommendations
It also tried to replace
while let Some(arg) = args.next() {
with:
for arg in args.by_ref() {
but that doesn't work on trait objects.
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 4cfbcc7..de2ebb2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,19 +43,19 @@ fn parse_args() -> Result<bool, String> { let maybe_args = parser.run(&mut options, &mut std::env::args()); // help is special, check for it even if parser#run returned error. - let ref help = options[help_idx]; + let help = &options[help_idx]; if help.is_set() { parser.print_help(&options); return Ok(true); } let args = maybe_args?; - let ref version = options[version_idx]; + let version = &options[version_idx]; if version.is_set() { println!("Version is 0.0.1"); return Ok(true); } - let ref verbose = options[verbose_idx]; + let verbose = &options[verbose_idx]; println!("verbose: {}", verbose.is_set()); println!("args: {:?}", args.args); Ok(false) |
