about summary refs log tree commit diff
path: root/src/librust
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2013-03-02 21:49:50 -0800
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2013-03-05 19:37:04 -0800
commit359bb3e10bb022aabc5bfc60e48d3dfffc2ee62c (patch)
tree9d07692401079d56e4ac81a34fd908f615b0e223 /src/librust
parent431e756fd72df1c092e71f6e605e82385a9c6881 (diff)
downloadrust-359bb3e10bb022aabc5bfc60e48d3dfffc2ee62c.tar.gz
rust-359bb3e10bb022aabc5bfc60e48d3dfffc2ee62c.zip
core: convert vec::{head,head_opt} to return references
Diffstat (limited to 'src/librust')
-rw-r--r--src/librust/rust.rc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/librust/rust.rc b/src/librust/rust.rc
index 37e0f874b40..235ed6412a3 100644
--- a/src/librust/rust.rc
+++ b/src/librust/rust.rc
@@ -130,7 +130,7 @@ fn cmd_help(args: &[~str]) -> ValidUsage {
                     UsgExec(commandline) => {
                         let words = str::words(commandline);
                         let (prog, args) = (words.head(), words.tail());
-                        run::run_program(prog, args);
+                        run::run_program(*prog, args);
                     }
                 }
                 Valid
@@ -186,7 +186,10 @@ fn do_command(command: &Command, args: &[~str]) -> ValidUsage {
         Exec(commandline) => {
             let words = str::words(commandline);
             let (prog, prog_args) = (words.head(), words.tail());
-            let exitstatus = run::run_program(prog, prog_args + args);
+            let exitstatus = run::run_program(
+                *prog,
+                vec::append(vec::from_slice(prog_args), args)
+            );
             os::set_exit_status(exitstatus);
             Valid
         }
@@ -221,11 +224,12 @@ fn usage() {
 }
 
 pub fn main() {
-    let args = os::args().tail();
+    let os_args = os::args();
+    let args = os_args.tail();
 
     if !args.is_empty() {
         for commands.each |command| {
-            if command.cmd == args.head() {
+            if command.cmd == *args.head() {
                 let result = do_command(command, args.tail());
                 if result.is_valid() { return; }
             }