Use open_url from the platform module
And remove the open function from the `util` crate.
This commit is contained in:
parent
015b8db1c3
commit
7a667f390b
3 changed files with 4 additions and 19 deletions
|
@ -9,7 +9,6 @@ use rand::{seq::SliceRandom, Rng};
|
|||
use std::{
|
||||
cmp::Ordering,
|
||||
ops::AddAssign,
|
||||
path::Path,
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
@ -54,17 +53,6 @@ pub fn truncate_and_trailoff(s: &str, max_chars: usize) -> String {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn open<P: AsRef<Path>>(path: P) {
|
||||
let path_to_open = path.as_ref().to_string_lossy();
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
std::process::Command::new("open")
|
||||
.arg(path_to_open.as_ref())
|
||||
.spawn()
|
||||
.log_err();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn post_inc<T: From<u8> + AddAssign<T> + Copy>(value: &mut T) -> T {
|
||||
let prev = *value;
|
||||
*value += T::from(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue