Commit 0a324f84 authored by Ian Jackson's avatar Ian Jackson
Browse files

mistrust: Canonicalise prefix from Some("") to None

This allows us to add the proper default example to the arti example
config file.
parent ca60859d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@
# (This is not the default.)
#
#     ignore_prefix = "/home/"
#ignore_prefix = ""

# Replacement values for consensus parameters.  This is an advanced option
# and you probably should leave it alone. Not all parameters are supported.
+1 −0
Original line number Diff line number Diff line
@@ -358,6 +358,7 @@ pub struct Mistrust {
#[allow(clippy::option_option)]
fn canonicalize_opt_prefix(prefix: &Option<Option<PathBuf>>) -> Result<Option<PathBuf>> {
    match prefix {
        Some(Some(path)) if path.as_os_str().is_empty() => Ok(None),
        Some(Some(path)) => Ok(Some(
            path.canonicalize()
                .map_err(|e| Error::inspecting(e, path))?,