diff --git a/src/command.rs b/src/command.rs index 17b1056..e329d54 100644 --- a/src/command.rs +++ b/src/command.rs @@ -40,7 +40,7 @@ pub fn command_event_loop( match command_request_receiver.recv() { Ok(command_request) => { event_sender.send(EventMessage::CommandCompleted( - match run_inner(command_request) { + match run_inner(&command_request) { Ok(c) => { // If there was no stdout and the command failed, don't touch stdout if !c.status_success && c.stdout.len_bytes() == 0 { @@ -62,7 +62,7 @@ pub fn command_event_loop( } } -fn run_inner(command_request: CommandRequest) -> Result { +fn run_inner(command_request: &CommandRequest) -> Result { // Spawn the child let mut child = { let request = command_request.0.read(); diff --git a/src/main.rs b/src/main.rs index d090698..1c8cf75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -423,9 +423,9 @@ fn run_app(terminal: &mut Terminal, app: App) -> Result { command_options.command_result = Some(CommandResult { status_success: false, - stderr: stderr, + stderr, stdout: Rope::from_str(""), - }) + }); } }, }