From 62555c997e63a2d851708ecb3d95063e7df61727 Mon Sep 17 00:00:00 2001 From: Wind Date: Tue, 16 Apr 2024 19:41:43 +0800 Subject: [PATCH] remove useless path.rs (#12534) # Description Sorry for introducing a useless file in previous pr, I have renamed it from `glob.rs` to `path.rs`, but forget removing it. --- crates/nu-protocol/src/value/path.rs | 33 ---------------------------- 1 file changed, 33 deletions(-) delete mode 100644 crates/nu-protocol/src/value/path.rs diff --git a/crates/nu-protocol/src/value/path.rs b/crates/nu-protocol/src/value/path.rs deleted file mode 100644 index aede5b4466..0000000000 --- a/crates/nu-protocol/src/value/path.rs +++ /dev/null @@ -1,33 +0,0 @@ -use serde::Deserialize; -use std::fmt::Display; - -#[derive(Debug, Clone, Deserialize)] -pub enum NuGlob { - /// A quoted path(except backtick), in this case, nushell shouldn't auto-expand path. - NoExpand(String), - /// An unquoted path, in this case, nushell should auto-expand path. - NeedExpand(String), -} - -impl NuGlob { - pub fn strip_ansi_string_unlikely(self) -> Self { - match self { - NuGlob::NoExpand(s) => NuGlob::NoExpand(nu_utils::strip_ansi_string_unlikely(s)), - NuGlob::NeedExpand(s) => NuGlob::NeedExpand(nu_utils::strip_ansi_string_unlikely(s)), - } - } -} - -impl AsRef for NuGlob { - fn as_ref(&self) -> &str { - match self { - NuGlob::NoExpand(s) | NuGlob::NeedExpand(s) => s, - } - } -} - -impl Display for NuGlob { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.as_ref()) - } -}