From edf1fbd83b6ccc541ffd513450eb12ad1bdd07d5 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 4 Jan 2022 09:45:27 -0800 Subject: [PATCH] Use `Context` suffix for snafu error contexts (#1068) --- src/config.rs | 2 +- src/config_error.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index c20bdd16..0587916a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -416,7 +416,7 @@ impl Config { } pub(crate) fn from_matches(matches: &ArgMatches) -> ConfigResult { - 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 diff --git a/src/config_error.rs b/src/config_error.rs index ce4d3d7b..af14c007 100644 --- a/src/config_error.rs +++ b/src/config_error.rs @@ -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 },