Skip to content

Commit

Permalink
Remove a dead trait InjectLib.
Browse files Browse the repository at this point in the history
The Rust compiler didn't warn about it: rust-lang/rust#41883
  • Loading branch information
marmistrz committed Aug 1, 2017
1 parent eb71206 commit b3951ae
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ use randmockery::syscall_override::{getrandom, time};

use std::process::Command;

trait InjectLib {
fn inject_lib(&mut self, &str);
}

impl InjectLib for Command {
fn inject_lib(&mut self, lib: &str) {
use std::os::unix::process::CommandExt;
let lib_s = String::from(lib);
self.before_exec(move || {
println!("Loading library {}", lib_s);
match libloading::Library::new(&lib_s) {
Err(err) => panic!("Error loading library: {}", err),
Ok(_) => Ok(()),
}
});
}
}

fn main() {
let matches = args::get_parser().get_matches();

Expand Down

0 comments on commit b3951ae

Please sign in to comment.