mirror of
https://github.com/casey/just.git
synced 2024-11-23 02:44:56 +03:00
Use Context
suffix for snafu error contexts (#1068)
This commit is contained in:
parent
c89dad9498
commit
edf1fbd83b
@ -416,7 +416,7 @@ impl Config {
|
||||
}
|
||||
|
||||
pub(crate) fn from_matches(matches: &ArgMatches) -> ConfigResult<Self> {
|
||||
let invocation_directory = env::current_dir().context(config_error::CurrentDirSnafu)?;
|
||||
let invocation_directory = env::current_dir().context(config_error::CurrentDirContext)?;
|
||||
|
||||
let verbosity = if matches.is_present(arg::QUIET) {
|
||||
Verbosity::Quiet
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::common::*;
|
||||
|
||||
#[derive(Debug, Snafu)]
|
||||
#[snafu(visibility(pub(crate)))]
|
||||
#[snafu(visibility(pub(crate)), context(suffix(Context)))]
|
||||
pub(crate) enum ConfigError {
|
||||
#[snafu(display("Failed to get current directory: {}", source))]
|
||||
CurrentDir { source: io::Error },
|
||||
|
Loading…
Reference in New Issue
Block a user