Remove borrowing that was introduced in previous release

This commit is contained in:
Félix Saparelli 2019-10-28 22:32:08 +13:00
parent 05c0d4aaea
commit e33fd8f5b5
No known key found for this signature in database
GPG key ID: 25940898BB90EA51
2 changed files with 7 additions and 7 deletions

View file

@ -3,5 +3,5 @@ extern crate watchexec;
use watchexec::{cli, error, run};
fn main() -> error::Result<()> {
run(&cli::get_args()?)
run(cli::get_args()?)
}

View file

@ -145,14 +145,14 @@ where
Ok(())
}
pub struct ExecHandler<'a> {
args: &'a Args,
pub struct ExecHandler {
args: Args,
signal: Option<Signal>,
child_process: Arc<RwLock<Option<Process>>>,
}
impl<'a> ExecHandler<'a> {
pub fn new(args: &'a Args) -> Result<Self> {
impl ExecHandler {
pub fn new(args: Args) -> Result<Self> {
let child_process: Arc<RwLock<Option<Process>>> = Arc::new(RwLock::new(None));
let weak_child = Arc::downgrade(&child_process);
@ -191,7 +191,7 @@ impl<'a> ExecHandler<'a> {
}
}
impl<'a> Handler for ExecHandler<'a> {
impl Handler for ExecHandler {
fn args(&self) -> Args {
self.args.clone()
}
@ -255,7 +255,7 @@ impl<'a> Handler for ExecHandler<'a> {
}
}
pub fn run(args: &Args) -> Result<()> {
pub fn run(args: Args) -> Result<()> {
watch(&ExecHandler::new(args)?)
}