diff --git a/crates/nu-command/src/filesystem/du.rs b/crates/nu-command/src/filesystem/du.rs index f233af1f60..cb1c5572c8 100644 --- a/crates/nu-command/src/filesystem/du.rs +++ b/crates/nu-command/src/filesystem/du.rs @@ -18,7 +18,7 @@ pub struct DuArgs { path: Option>, all: bool, deref: bool, - exclude: Option>, + exclude: Option>, #[serde(rename = "max-depth")] max_depth: Option>, #[serde(rename = "min-size")] @@ -110,7 +110,7 @@ impl Command for Du { }; let exclude = args.exclude.map_or(Ok(None), move |x| { - Pattern::new(&x.item) + Pattern::new(x.item.as_ref()) .map(Some) .map_err(|e| ShellError::InvalidGlobPattern { msg: e.msg.into(),