diff options
| author | LLLL Colonq <llll@colonq> | 2026-10-13 13:27:16 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-10-13 13:27:16 -0400 |
| commit | 22820dbea9b2db898e5f54e26ab9574784e340d8 (patch) | |
| tree | f2af5db65d05efb0c67b34d19f1b2c59664f5e93 /crates/elfmind/src/noun | |
| parent | c4ee47647a5bf1a06ae88ebb9410117c927868ee (diff) | |
Tweaks to datalog
Diffstat (limited to 'crates/elfmind/src/noun')
| -rw-r--r-- | crates/elfmind/src/noun/character.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/elfmind/src/noun/character.rs b/crates/elfmind/src/noun/character.rs index e6029c0..800b0de 100644 --- a/crates/elfmind/src/noun/character.rs +++ b/crates/elfmind/src/noun/character.rs @@ -39,3 +39,15 @@ pub enum CharacterMasked { Rat, Pig, } +impl From<CharacterMasked> for Noun { fn from(x: CharacterMasked) -> Self {Noun::CharacterMasked(x)} } +impl TryFrom<Noun> for CharacterMasked { + type Error = (); + fn try_from(v: Noun) -> Result<Self, Self::Error> { + if let Noun::CharacterMasked(x) = v { Ok(x) } else { Err(()) } + } +} +impl DisplayNoun for CharacterMasked { + fn display_noun(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } +} |
