From df358d296fc40801e970654bf2b689577637db5e Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 12 Jun 2022 09:32:01 +0800 Subject: [PATCH] fix: deprecate `that_in_background()` as `that()` is definitely non-blocking now. Note that we keep `with_in_background()` as it's unclear if a custom launcher blocks or not. --- src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c9029fd..bed2b13 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,16 +119,18 @@ pub fn with>(path: T, app: impl Into) -> io::Result<()> os::with(path, app) } -/// Open path with the default application in a new thread, which is useful if -/// the program ends up to be blocking. Otherwise, prefer [`that()`]. +/// Open path with the default application in a new thread. /// /// See documentation of [`that()`] for more details. +#[deprecated = "Use `that()` as it is non-blocking while making error handling easy."] pub fn that_in_background>(path: T) -> thread::JoinHandle> { let path = path.as_ref().to_os_string(); thread::spawn(|| that(path)) } -/// Open path with the given application in a new thread. +/// Open path with the given application in a new thread, which is useful if +/// the program ends up to be blocking. Otherwise, prefer [`with()`] for +/// straightforward error handling. /// /// See documentation of [`with()`] for more details. pub fn with_in_background>(