]> git.lizzy.rs Git - rust.git/commitdiff
Replace unneeded owned `Vec` usage with `slice`.
authorCorey Farwell <coreyf@rwell.org>
Sun, 20 Mar 2016 03:37:13 +0000 (23:37 -0400)
committerCorey Farwell <coreyf@rwell.org>
Sun, 20 Mar 2016 04:04:59 +0000 (00:04 -0400)
src/librustc_driver/lib.rs

index 357c7238c1f6c9572a939d1b90615c005083688d..d4f164b6e24be6a13f93eaf806644e58e13b6c60 100644 (file)
@@ -157,7 +157,7 @@ macro_rules! do_or_return {($expr: expr, $sess: expr) => {
         }
     }}
 
-    let matches = match handle_options(args.to_vec()) {
+    let matches = match handle_options(args) {
         Some(matches) => matches,
         None => return (Ok(()), None),
     };
@@ -870,9 +870,9 @@ fn print_flag_list<T>(cmdline_opt: &str,
 ///
 /// So with all that in mind, the comments below have some more detail about the
 /// contortions done here to get things to work out correctly.
-pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> {
+pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
     // Throw away the first argument, the name of the binary
-    let _binary = args.remove(0);
+    let args = &args[1..];
 
     if args.is_empty() {
         // user did not write `-v` nor `-Z unstable-options`, so do not