diff options
author | Canop <cano.petrole@gmail.com> | 2022-04-03 20:01:10 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-04-03 20:01:10 +0200 |
commit | 5231feaf61b47c8749ed9ba303a58b3d9516483f (patch) | |
tree | fbf2aa1a1ae47c01f9c899575229db356f1f7136 /src | |
parent | 2fee8a4ede870ba82668bd282499dbd83b7e2566 (diff) |
replace the 'opener' crate with 'open'
Fix #530
Diffstat (limited to 'src')
-rw-r--r-- | src/browser/browser_state.rs | 4 | ||||
-rw-r--r-- | src/errors.rs | 5 | ||||
-rw-r--r-- | src/help/help_state.rs | 2 | ||||
-rw-r--r-- | src/launchable.rs | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/browser/browser_state.rs b/src/browser/browser_state.rs index 94060b5..1264be0 100644 --- a/src/browser/browser_state.rs +++ b/src/browser/browser_state.rs @@ -15,7 +15,7 @@ use { tree_build::TreeBuilder, verb::*, }, - open, + opener, std::path::{Path, PathBuf}, }; @@ -136,7 +136,7 @@ impl BrowserState { in_new_panel, )) } else { - match open::that(&target) { + match opener::open(&target) { Ok(exit_status) => { info!("open returned with exit_status {:?}", exit_status); Ok(CmdResult::Keep) diff --git a/src/errors.rs b/src/errors.rs index 33a65e2..4845b1c 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,8 +8,8 @@ use { }; custom_error! {pub ProgramError - Io {source: io::Error} = "IO Error : {:?}", - Termimad {source: termimad::Error} = "Termimad Error : {:?}", + Io {source: io::Error} = "IO Error : {}", + Termimad {source: termimad::Error} = "Termimad Error : {}", Conf {source: ConfError} = "Bad configuration: {}", ConfFile {path:String, details: ConfError} = "Bad configuration file {:?} : {}", ArgParse {bad: String, valid: String} = "{:?} can't be parsed (valid values: {:?})", @@ -29,6 +29,7 @@ custom_error! {pub ProgramError UnmappableFile = "File can't be mapped", UnprintableFile = "File can't be printed", // has characters that can't be printed without escaping SyntectCrashed { details: String } = "Syntect crashed on {details:?}", + OpenError { source: opener::OpenError } = "Open error: {}", } custom_error! {pub TreeBuildError diff --git a/src/help/help_state.rs b/src/help/help_state.rs index 1f5800e..ccdd26a 100644 --- a/src/help/help_state.rs +++ b/src/help/help_state.rs @@ -213,7 +213,7 @@ impl PanelState for HelpState { }; CmdResult::Keep } - open_stay => match open::that(&Conf::default_location()) { + open_stay => match opener::open(&Conf::default_location()) { Ok(exit_status) => { info!("open returned with exit_status {:?}", exit_status); CmdResult::Keep diff --git a/src/launchable.rs b/src/launchable.rs index 9378cb2..af62f12 100644 --- a/src/launchable.rs +++ b/src/launchable.rs @@ -19,7 +19,7 @@ use { terminal::{self, EnterAlternateScreen, LeaveAlternateScreen}, QueueableCommand, }, - open, + opener, std::{ env, io::{self, Write}, @@ -178,7 +178,7 @@ impl Launchable { Ok(()) } Launchable::SystemOpen { path } => { - open::that(&path)?; + opener::open(&path)?; Ok(()) } } |