Skip to content

Commit a7354f9

Browse files
authored
feat(core): mark AppHandle::restart and process::restart as diverging functions (#10171)
closes #10160
1 parent eeae066 commit a7354f9

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": "patch:enhance"
3+
---
4+
5+
Mark `AppHandle::restart` and `process::restart` as [diverging functions](https://doc.rust-lang.org/rust-by-example/fn/diverging.html).

core/tauri/src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<R: Runtime> AppHandle<R> {
417417
}
418418

419419
/// Restarts the app by triggering [`RunEvent::ExitRequested`] with code [`RESTART_EXIT_CODE`] and [`RunEvent::Exit`]..
420-
pub fn restart(&self) {
420+
pub fn restart(&self) -> ! {
421421
if self.runtime_handle.request_exit(RESTART_EXIT_CODE).is_err() {
422422
self.cleanup_before_exit();
423423
}

core/tauri/src/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn current_binary(_env: &Env) -> std::io::Result<PathBuf> {
7171
/// Ok(())
7272
/// });
7373
/// ```
74-
pub fn restart(env: &Env) {
74+
pub fn restart(env: &Env) -> ! {
7575
use std::process::{exit, Command};
7676

7777
if let Ok(path) = current_binary(env) {

0 commit comments

Comments
 (0)