From e1f98c1bfd16108e18641ef220090fa101057a77 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Thu, 10 Feb 2022 00:20:46 +0100 Subject: [PATCH] Fix `trash-support` feature flag (#4394) Pass it through to be inclued with `--all-features` Make clippy without `--all-features` happy --- Cargo.toml | 1 + crates/nu-command/src/filesystem/rm.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 7c8e78b090..151ed0259d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,6 +77,7 @@ default = ["plugin", "inc", "example", "which"] stable = ["default"] extra = [ "default", "dataframe", "gstat", "zip-support", "query", ] wasi = ["inc"] +trash-support = ["nu-command/trash-support"] # Stable (Default) inc = ["nu_plugin_inc"] diff --git a/crates/nu-command/src/filesystem/rm.rs b/crates/nu-command/src/filesystem/rm.rs index a898ca080e..95bb8b2cef 100644 --- a/crates/nu-command/src/filesystem/rm.rs +++ b/crates/nu-command/src/filesystem/rm.rs @@ -1,4 +1,5 @@ use std::collections::HashMap; +#[cfg(feature = "trash-support")] use std::io::ErrorKind; #[cfg(unix)] use std::os::unix::prelude::FileTypeExt; @@ -73,6 +74,7 @@ fn rm( call: &Call, ) -> Result { let trash = call.has_flag("trash"); + #[cfg(feature = "trash-support")] let permanent = call.has_flag("permanent"); let recursive = call.has_flag("recursive"); let force = call.has_flag("force");