forked from Orchid/orchid
temp commit
This commit is contained in:
@@ -13,6 +13,7 @@ use crate::interner::Interner;
|
||||
use crate::{api, match_mapping};
|
||||
|
||||
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
||||
#[must_use]
|
||||
pub struct FmtUnit {
|
||||
pub subs: Vec<FmtUnit>,
|
||||
pub variants: Rc<Variants>,
|
||||
@@ -209,6 +210,9 @@ impl From<Rc<String>> for Variants {
|
||||
impl From<String> for Variants {
|
||||
fn from(value: String) -> Self { Self::from(Rc::new(value)) }
|
||||
}
|
||||
impl From<&str> for Variants {
|
||||
fn from(value: &str) -> Self { Self::from(value.to_string()) }
|
||||
}
|
||||
impl FromStr for Variants {
|
||||
type Err = Infallible;
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> { Ok(Self::default().bounded(s)) }
|
||||
@@ -265,6 +269,7 @@ impl FmtCtx for FmtCtxImpl<'_> {
|
||||
}
|
||||
|
||||
pub trait Format {
|
||||
#[must_use]
|
||||
fn print<'a>(&'a self, c: &'a (impl FmtCtx + ?Sized + 'a)) -> impl Future<Output = FmtUnit> + 'a;
|
||||
}
|
||||
impl Format for Never {
|
||||
|
||||
Reference in New Issue
Block a user