diff options
| author | Teddy Wing | 2022-08-20 19:25:47 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2022-08-20 19:25:47 +0200 | 
| commit | 4dfe6642eafff6638dc09c673eb1ac727d1438d9 (patch) | |
| tree | d624ed5bf5c27e33872c930c0977c20474777700 | |
| parent | 23afdba000d97c4e37b4adfaeb91b93c57e9966f (diff) | |
| download | Passextract-4dfe6642eafff6638dc09c673eb1ac727d1438d9.tar.bz2 | |
main: Rename `options` variable to `copy_options`
When investigating how to add a `--version` argument, I was confused by
this naming and thought that "options" referred to command line options.
Rename the variable to make its purpose clearer.
| -rw-r--r-- | src/main.rs | 12 | 
1 files changed, 6 insertions, 6 deletions
| diff --git a/src/main.rs b/src/main.rs index 8a52dc1..fbbd252 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,9 +130,9 @@ fn main() {          "-"      }; -    let options = parse_options(input); +    let copy_options = parse_options(input); -    if options.is_empty() { +    if copy_options.is_empty() {          // TODO: 66 noinput          process::exit(1);      } @@ -153,7 +153,7 @@ fn main() {          term.printline_with_cell(selection.x, selection.y, "->", knockout_cell); -        for (i, s) in options.iter().enumerate() { +        for (i, s) in copy_options.iter().enumerate() {              if hide_password && is_password_line(s) {                  term.printline(5, i + 2, &hide_password_line(s))              } else { @@ -172,7 +172,7 @@ fn main() {                      }                  }                  'j' => { -                    if selection.y < options.len() + 1 { +                    if selection.y < copy_options.len() + 1 {                          let y = selection.y;                          move_selection(&mut term, &mut selection, knockout_cell, y + 1)                      } @@ -187,10 +187,10 @@ fn main() {                      move_selection(&mut term, &mut selection, knockout_cell, 2)                  }                  'G' => { -                    move_selection(&mut term, &mut selection, knockout_cell, options.len() + 1) +                    move_selection(&mut term, &mut selection, knockout_cell, copy_options.len() + 1)                  }                  '\x0D' => { -                    match clipboard_ctx.set_contents(strip_key(&options[selection.y - 2]).to_owned()) { +                    match clipboard_ctx.set_contents(strip_key(©_options[selection.y - 2]).to_owned()) {                          Ok(_) => {                              term.printline_with_cell(selection.x, selection.y, "->", green_cell);                          }, | 
