refactor: type

This commit is contained in:
2025-05-03 20:33:59 +08:00
parent 3f0cb2c2fa
commit 4a310ff317
23 changed files with 475 additions and 309 deletions

26
src/ty/common.rs Normal file
View File

@@ -0,0 +1,26 @@
use std::ops::Deref;
use ecow::EcoString;
use derive_more::Constructor;
#[derive(Clone, Debug, PartialEq, Constructor)]
pub struct Catchable {
msg: Option<String>,
}
#[derive(Debug, Clone, Hash, PartialEq, Eq, Constructor)]
pub struct Symbol(EcoString);
impl<T: Into<EcoString>> From<T> for Symbol {
fn from(value: T) -> Self {
Symbol(value.into())
}
}
impl Deref for Symbol {
type Target = str;
fn deref(&self) -> &Self::Target {
&self.0
}
}