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.
This commit is contained in:
Wind 2024-04-16 19:41:43 +08:00 committed by GitHub
parent 03317ff92e
commit 62555c997e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<str> 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())
}
}