From 9a231d8c163414d462a185d955e6887b64704802 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 4 Aug 2026 14:44:50 +0800 Subject: refactor(metadata): move metadata module to core crate --- mingling/src/metadata.rs | 3 +- mingling/src/metadata/description.rs | 57 ------------------------------------ 2 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 mingling/src/metadata/description.rs (limited to 'mingling/src') diff --git a/mingling/src/metadata.rs b/mingling/src/metadata.rs index 329576c..06fcec9 100644 --- a/mingling/src/metadata.rs +++ b/mingling/src/metadata.rs @@ -1,2 +1 @@ -mod description; -pub use description::*; +pub use mingling_core::metadata::*; diff --git a/mingling/src/metadata/description.rs b/mingling/src/metadata/description.rs deleted file mode 100644 index 48bf095..0000000 --- a/mingling/src/metadata/description.rs +++ /dev/null @@ -1,57 +0,0 @@ -/// Provides a description for any Grouped type. -pub struct Description { - desc: String, -} - -impl Description { - /// Creates a new `Description` instance. - pub fn new>(desc: S) -> Self { - Self { desc: desc.into() } - } -} - -impl From for Description { - fn from(desc: String) -> Self { - Self { desc } - } -} - -impl From<&str> for Description { - fn from(desc: &str) -> Self { - Self { - desc: desc.to_string(), - } - } -} - -impl From for String { - fn from(desc: Description) -> Self { - desc.desc - } -} - -impl From<&Description> for String { - fn from(desc: &Description) -> Self { - desc.desc.clone() - } -} - -impl std::ops::Deref for Description { - type Target = str; - - fn deref(&self) -> &Self::Target { - &self.desc - } -} - -impl std::ops::DerefMut for Description { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.desc - } -} - -impl std::fmt::Display for Description { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", self.desc) - } -} -- cgit