mirror of
https://github.com/nushell/nushell.git
synced 2024-11-25 01:43:47 +01:00
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:
parent
03317ff92e
commit
62555c997e
@ -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())
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user