Skip to content

Commit

Permalink
Replace unneeded owned Vec usage with slice.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Mar 20, 2016
1 parent 151be09 commit 4238d0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/librustc_driver/lib.rs
Expand Up @@ -157,7 +157,7 @@ pub fn run_compiler<'a>(args: &[String],
}
}}

let matches = match handle_options(args.to_vec()) {
let matches = match handle_options(args) {
Some(matches) => matches,
None => return (Ok(()), None),
};
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4238d0b

Please sign in to comment.