-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Is there a way to generate this Display implementation? Note that this is not a write!(f, "{0}", v), but rather v.fmt(f) call.
use std::fmt;
pub enum Term {
Int(i32),
Float(f64),
Str(String),
}
impl fmt::Display for Term {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::Int(v) => v.fmt(f),
Self::Float(v) => v.fmt(f),
Self::Str(v) => v.fmt(f),
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels