Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
refactor: drop unnecessary result type for capture method
Lars Wirzenius committed 4 months ago
commit e681fc88840c9594896a116782126970d61101ff
parent e90dfeb
1 file changed +4 -5
modified src/timeoutcmd.rs
@@ -221,7 +221,7 @@ impl ChildProcess {
            .stderr
            .take()
            .ok_or(TimeoutError::TakeHandle("stderr"))?;
-
        let stderr_thread = Self::capture(stderr)?;
+
        let stderr_thread = Self::capture(stderr);

        // Launch a thread that notifies the `CondVar` when the child
        // has been running too long.
@@ -336,8 +336,8 @@ impl ChildProcess {
    // everything.
    fn capture(
        mut stream: impl Read + Send + 'static,
-
    ) -> Result<JoinHandle<Result<Vec<u8>, TimeoutError>>, TimeoutError> {
-
        let thread = spawn(move || {
+
    ) -> JoinHandle<Result<Vec<u8>, TimeoutError>> {
+
        spawn(move || {
            let mut buf = vec![];
            loop {
                let mut chunk = vec![0; MIB];
@@ -351,8 +351,7 @@ impl ChildProcess {
                    }
                }
            }
-
        });
-
        Ok(thread)
+
        })
    }
}