Skip to content

Commit

Permalink
clippy: Remove needless borrows.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys committed Mar 20, 2018
1 parent 07c15d2 commit 3dfc5dc
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/01a_quick_example.rs
Expand Up @@ -64,7 +64,7 @@ fn main() {

// You can check for the existence of subcommands, and if found use their
// matches just as you would the top level app
if let Some(ref matches) = matches.subcommand_matches("test") {
if let Some(matches) = matches.subcommand_matches("test") {
// "$ myapp test" was run
if matches.is_present("list") {
// "$ myapp test -l" was run
Expand Down
2 changes: 1 addition & 1 deletion examples/01b_quick_example.rs
Expand Up @@ -78,7 +78,7 @@ fn main() {

// You can check for the existence of subcommands, and if found use their
// matches just as you would the top level app
if let Some(ref matches) = matches.subcommand_matches("test") {
if let Some(matches) = matches.subcommand_matches("test") {
// "$ myapp test" was run
if matches.is_present("list") {
// "$ myapp test -l" was run
Expand Down
2 changes: 1 addition & 1 deletion examples/04_using_matches.rs
Expand Up @@ -42,7 +42,7 @@ fn main() {

// If we wanted to some custom initialization based off some configuration file provided
// by the user, we could get the file (A string of the file)
if let Some(ref file) = matches.value_of("config") {
if let Some(file) = matches.value_of("config") {
println!("Using config file: {}", file);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/06_positional_args.rs
Expand Up @@ -48,7 +48,7 @@ fn main() {
}

// We can also get the values for those arguments
if let Some(ref in_file) = matches.value_of("input") {
if let Some(in_file) = matches.value_of("input") {
// It's safe to call unwrap() because of the required options we set above
println!("Doing work with {} and {}", in_file, matches.value_of("config").unwrap());
}
Expand Down
2 changes: 1 addition & 1 deletion examples/07_option_args.rs
Expand Up @@ -49,7 +49,7 @@ fn main() {
//
// NOTE: If we specified multiple(), this will only return the _FIRST_
// occurrence
if let Some(ref in_file) = matches.value_of("input") {
if let Some(in_file) = matches.value_of("input") {
println!("An input file: {}", in_file);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/08_subcommands.rs
Expand Up @@ -41,7 +41,7 @@ fn main() {
}

// You can get the independent subcommand matches (which function exactly like App matches)
if let Some(ref matches) = matches.subcommand_matches("add") {
if let Some(matches) = matches.subcommand_matches("add") {
// Safe to use unwrap() because of the required() option
println!("Adding file: {}", matches.value_of("input").unwrap());
}
Expand Down
4 changes: 2 additions & 2 deletions examples/18_builder_macro.rs
Expand Up @@ -41,7 +41,7 @@ fn main() {
(@arg list: -l "Lists test values")
(@arg test_req: -r requires[list] "Tests requirement for listing")
(@arg aaaa: --aaaa +takes_value {
|a| if a.contains("a") {
|a| if a.contains('a') {
Ok(())
} else {
Err(String::from("string does not contain at least one a"))
Expand Down Expand Up @@ -70,7 +70,7 @@ fn main() {

// You can check for the existence of subcommands, and if found use their
// matches just as you would the top level app
if let Some(ref matches) = matches.subcommand_matches("test") {
if let Some(matches) = matches.subcommand_matches("test") {
// "$ myapp test" was run
if matches.is_present("list") {
// "$ myapp test -l" was run
Expand Down
2 changes: 1 addition & 1 deletion examples/21_aliases.rs
Expand Up @@ -23,7 +23,7 @@ fn main() {
}

// You can get the independent subcommand matches (which function exactly like App matches)
if let Some(ref matches) = matches.subcommand_matches("add") {
if let Some(matches) = matches.subcommand_matches("add") {
// Safe to use unwrap() because of the required() option
println!("Adding file: {}", matches.value_of("input").unwrap());
}
Expand Down

0 comments on commit 3dfc5dc

Please sign in to comment.