fix(tauri-cli): remove busy-looping

This commit is contained in:
c 2026-01-26 22:14:53 +01:00 committed by sftse
parent aada6a4422
commit ff3c01e5b0
No known key found for this signature in database
4 changed files with 1 additions and 14 deletions

View File

@ -21,7 +21,6 @@ pub use rust::{MobileOptions, Options, Rust as AppInterface, WatcherOptions};
pub trait DevProcess {
fn kill(&self) -> std::io::Result<()>;
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>>;
#[allow(unused)]
fn wait(&self) -> std::io::Result<ExitStatus>;
#[allow(unused)]

View File

@ -584,11 +584,7 @@ impl Rust {
// wait for the process to exit
// note that on mobile, kill() already waits for the process to exit (duct implementation)
loop {
if !matches!(child.try_wait(), Ok(None)) {
break;
}
}
let _ = child.wait();
child = run(self, config)?;
}
}

View File

@ -33,10 +33,6 @@ impl DevProcess for DevChild {
Ok(())
}
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>> {
self.dev_child.try_wait()
}
fn wait(&self) -> std::io::Result<ExitStatus> {
self.dev_child.wait()
}

View File

@ -77,10 +77,6 @@ impl DevProcess for DevChild {
}
}
fn try_wait(&self) -> std::io::Result<Option<ExitStatus>> {
self.child.try_wait().map(|res| res.map(|o| o.status))
}
fn wait(&self) -> std::io::Result<ExitStatus> {
self.child.wait().map(|o| o.status)
}