about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-15 00:10:29 -0700
committerbors <bors@rust-lang.org>2016-03-15 00:10:29 -0700
commit4db8b5bfdf1c0f70183f5a416581215c62412f80 (patch)
treed6a09044df048c1e73b99aa339a93e7056580469
parent34b95a3c6a2a56d76bbd8ae19f318c03a2e5041d (diff)
parent8f008ba4eed563cc2995509048ae638a64426a96 (diff)
downloadrust-4db8b5bfdf1c0f70183f5a416581215c62412f80.tar.gz
rust-4db8b5bfdf1c0f70183f5a416581215c62412f80.zip
Auto merge of #32238 - frewsxcv:compiletest, r=alexcrichton
Utilize `Option::cloned` over explicit `clone` usage.
-rw-r--r--src/compiletest/compiletest.rs13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs
index 74c02d00a0a..458a3a8c739 100644
--- a/src/compiletest/compiletest.rs
+++ b/src/compiletest/compiletest.rs
@@ -116,12 +116,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
         }
     }
 
-    let filter = if !matches.free.is_empty() {
-        Some(matches.free[0].clone())
-    } else {
-        None
-    };
-
     Config {
         compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
         run_lib_path: matches.opt_str("run-lib-path").unwrap(),
@@ -137,7 +131,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
         stage_id: matches.opt_str("stage-id").unwrap(),
         mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
         run_ignored: matches.opt_present("ignored"),
-        filter: filter,
+        filter: matches.free.first().cloned(),
         logfile: matches.opt_str("logfile").map(|s| PathBuf::from(&s)),
         runtool: matches.opt_str("runtool"),
         host_rustcflags: matches.opt_str("host-rustcflags"),
@@ -251,10 +245,7 @@ pub fn run_tests(config: &Config) {
 
 pub fn test_opts(config: &Config) -> test::TestOpts {
     test::TestOpts {
-        filter: match config.filter {
-            None => None,
-            Some(ref filter) => Some(filter.clone()),
-        },
+        filter: config.filter.clone(),
         run_ignored: config.run_ignored,
         logfile: config.logfile.clone(),
         run_tests: true,