oxilean_kernel/expr/literal_traits.rs
1//! # Literal - Trait Implementations
2//!
3//! This module contains trait implementations for `Literal`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::functions::has_loose_bvar;
12use super::types::Literal;
13use std::fmt;
14
15impl fmt::Display for Literal {
16 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17 match self {
18 Literal::Nat(n) => write!(f, "{}", n),
19 Literal::Str(s) => write!(f, "\"{}\"", s),
20 }
21 }
22}