Skip to content

Commit 4238d0b

Browse files
committed
Replace unneeded owned Vec usage with slice.
1 parent 151be09 commit 4238d0b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_driver/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ pub fn run_compiler<'a>(args: &[String],
157157
}
158158
}}
159159

160-
let matches = match handle_options(args.to_vec()) {
160+
let matches = match handle_options(args) {
161161
Some(matches) => matches,
162162
None => return (Ok(()), None),
163163
};
@@ -870,9 +870,9 @@ fn print_flag_list<T>(cmdline_opt: &str,
870870
///
871871
/// So with all that in mind, the comments below have some more detail about the
872872
/// contortions done here to get things to work out correctly.
873-
pub fn handle_options(mut args: Vec<String>) -> Option<getopts::Matches> {
873+
pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
874874
// Throw away the first argument, the name of the binary
875-
let _binary = args.remove(0);
875+
let args = &args[1..];
876876

877877
if args.is_empty() {
878878
// user did not write `-v` nor `-Z unstable-options`, so do not

0 commit comments

Comments
 (0)