diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-29 21:48:23 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-29 21:48:23 +0800 |
| commit | 596e5e2440df2d32f1cf3e052dc633e774edf6ee (patch) | |
| tree | dc98eb6a1789847b899207d0b99337bb3ccd92a5 /mingling/src/asset/node.rs | |
| parent | 25a164f74c011e6e78846f226cbd7a8bd87db92f (diff) | |
Rename mingling to mingling_core and update dependencies
Diffstat (limited to 'mingling/src/asset/node.rs')
| -rw-r--r-- | mingling/src/asset/node.rs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mingling/src/asset/node.rs b/mingling/src/asset/node.rs deleted file mode 100644 index c8b7600..0000000 --- a/mingling/src/asset/node.rs +++ /dev/null @@ -1,54 +0,0 @@ -use just_fmt::kebab_case; - -#[derive(Debug, Default)] -pub struct Node { - node: Vec<String>, -} - -impl Node { - pub fn join(self, node: impl Into<String>) -> Node { - let mut new_node = self.node; - new_node.push(node.into()); - Node { node: new_node } - } -} - -impl From<&str> for Node { - fn from(s: &str) -> Self { - let node = s.split('.').map(|part| kebab_case!(part)).collect(); - Node { node } - } -} - -impl From<String> for Node { - fn from(s: String) -> Self { - let node = s.split('.').map(|part| kebab_case!(part)).collect(); - Node { node } - } -} - -impl PartialEq for Node { - fn eq(&self, other: &Self) -> bool { - self.node == other.node - } -} - -impl Eq for Node {} - -impl PartialOrd for Node { - fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { - Some(self.cmp(other)) - } -} - -impl Ord for Node { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.node.cmp(&other.node) - } -} - -impl std::fmt::Display for Node { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.node.join(".")) - } -} |
