|
96 | 96 |
|
97 | 97 | #![doc(
|
98 | 98 | html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
99 |
| - html_favicon_url = "https://www.rust-lang.org/favicon.ico", |
100 |
| - html_root_url = "https://docs.rs/getopts/0.2.21" |
| 99 | + html_favicon_url = "https://www.rust-lang.org/favicon.ico" |
101 | 100 | )]
|
102 | 101 | #![deny(missing_docs)]
|
103 | 102 | #![cfg_attr(test, deny(warnings))]
|
@@ -529,9 +528,7 @@ impl Options {
|
529 | 528 | // FloatingFrees is in use.
|
530 | 529 | if let Some(i_arg) = i_arg.take() {
|
531 | 530 | vals[opt_id].push((arg_pos, Val(i_arg)));
|
532 |
| - } else if was_long |
533 |
| - || args.peek().map_or(true, |n| is_arg(&n)) |
534 |
| - { |
| 531 | + } else if was_long || args.peek().map_or(true, |n| is_arg(&n)) { |
535 | 532 | vals[opt_id].push((arg_pos, Given));
|
536 | 533 | } else {
|
537 | 534 | vals[opt_id].push((arg_pos, Val(args.next().unwrap())));
|
@@ -565,7 +562,12 @@ impl Options {
|
565 | 562 | // in option does not exist in `free` and must be replaced with `None`
|
566 | 563 | args_end = args_end.filter(|pos| pos != &free.len());
|
567 | 564 |
|
568 |
| - Ok(Matches { opts, vals, free, args_end }) |
| 565 | + Ok(Matches { |
| 566 | + opts, |
| 567 | + vals, |
| 568 | + free, |
| 569 | + args_end, |
| 570 | + }) |
569 | 571 | }
|
570 | 572 |
|
571 | 573 | /// Derive a short one-line usage summary from a set of long options.
|
@@ -915,7 +917,10 @@ impl Matches {
|
915 | 917 | ///
|
916 | 918 | /// This function will panic if the option name is not defined.
|
917 | 919 | pub fn opt_positions(&self, name: &str) -> Vec<usize> {
|
918 |
| - self.opt_vals(name).into_iter().map(|(pos, _)| pos).collect() |
| 920 | + self.opt_vals(name) |
| 921 | + .into_iter() |
| 922 | + .map(|(pos, _)| pos) |
| 923 | + .collect() |
919 | 924 | }
|
920 | 925 |
|
921 | 926 | /// Returns true if any of several options were matched.
|
|
0 commit comments