Skip to content

Commit df358d2

Browse files
committed
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.
1 parent 3f51fb2 commit df358d2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,18 @@ pub fn with<T: AsRef<OsStr>>(path: T, app: impl Into<String>) -> io::Result<()>
119119
os::with(path, app)
120120
}
121121

122-
/// Open path with the default application in a new thread, which is useful if
123-
/// the program ends up to be blocking. Otherwise, prefer [`that()`].
122+
/// Open path with the default application in a new thread.
124123
///
125124
/// See documentation of [`that()`] for more details.
125+
#[deprecated = "Use `that()` as it is non-blocking while making error handling easy."]
126126
pub fn that_in_background<T: AsRef<OsStr>>(path: T) -> thread::JoinHandle<io::Result<()>> {
127127
let path = path.as_ref().to_os_string();
128128
thread::spawn(|| that(path))
129129
}
130130

131-
/// Open path with the given application in a new thread.
131+
/// Open path with the given application in a new thread, which is useful if
132+
/// the program ends up to be blocking. Otherwise, prefer [`with()`] for
133+
/// straightforward error handling.
132134
///
133135
/// See documentation of [`with()`] for more details.
134136
pub fn with_in_background<T: AsRef<OsStr>>(

0 commit comments

Comments
 (0)