mistrust: Canonicalise prefix from Some("") to None
This allows us to add the proper default example to the arti example config file.
This commit is contained in:
parent
ca60859dff
commit
0a324f843f
|
@ -97,6 +97,7 @@
|
||||||
# (This is not the default.)
|
# (This is not the default.)
|
||||||
#
|
#
|
||||||
# ignore_prefix = "/home/"
|
# ignore_prefix = "/home/"
|
||||||
|
#ignore_prefix = ""
|
||||||
|
|
||||||
# Replacement values for consensus parameters. This is an advanced option
|
# Replacement values for consensus parameters. This is an advanced option
|
||||||
# and you probably should leave it alone. Not all parameters are supported.
|
# and you probably should leave it alone. Not all parameters are supported.
|
||||||
|
|
|
@ -358,6 +358,7 @@ pub struct Mistrust {
|
||||||
#[allow(clippy::option_option)]
|
#[allow(clippy::option_option)]
|
||||||
fn canonicalize_opt_prefix(prefix: &Option<Option<PathBuf>>) -> Result<Option<PathBuf>> {
|
fn canonicalize_opt_prefix(prefix: &Option<Option<PathBuf>>) -> Result<Option<PathBuf>> {
|
||||||
match prefix {
|
match prefix {
|
||||||
|
Some(Some(path)) if path.as_os_str().is_empty() => Ok(None),
|
||||||
Some(Some(path)) => Ok(Some(
|
Some(Some(path)) => Ok(Some(
|
||||||
path.canonicalize()
|
path.canonicalize()
|
||||||
.map_err(|e| Error::inspecting(e, path))?,
|
.map_err(|e| Error::inspecting(e, path))?,
|
||||||
|
|
Loading…
Reference in New Issue