~samwhited/sinit

ece1813b502e0fe2dc2f337df6807707684fd03f — Sam Whited 2 years ago 26f3f76 master
Remove needless pass by value

See https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#needless_pass_by_value
1 files changed, 5 insertions(+), 5 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +5 -5
@@ 65,12 65,12 @@ fn main() {
        Err(f) => panic!(f.to_string()),
    };
    if matches.opt_present("h") {
        print_usage(&program, opts);
        print_usage(&program, &opts);
        return;
    }
    let sid = matches.opt_present("c");
    let cmd = if matches.free.is_empty() {
        print_usage(&program, opts);
        print_usage(&program, &opts);
        return;
    } else {
        matches.free[0].clone()


@@ 118,7 118,7 @@ fn main() {
    }
}

fn print_usage(program: &str, opts: getopts::Options) {
fn print_usage(program: &str, opts: &getopts::Options) {
    let brief = format!("Usage: {} [options] CMD", program);
    print!("{}", opts.usage(&brief));
}


@@ 143,8 143,8 @@ unsafe fn handle_signal(setsid: bool, pid: i32, sig: i32) {
                }

                let exit_status;
                // TODO: Only the first branch will ever be hit here because we didn't call fork(3) on
                // the child directly (so we're not the chlid that just exited).
                // TODO: Only the first branch will ever be hit here because we didn't call fork(3)
                // on the child directly (so we're not the child that just exited).
                if libc::WIFEXITED(status) {
                    exit_status = libc::WEXITSTATUS(status);
                    debugln!("A child with PID {} exited with exit status {}.",