oxilean-codegen 0.1.2

OxiLean code generator - LCNF-based compilation and optimization
Documentation
//! # LuaTableField - Trait Implementations
//!
//! This module contains trait implementations for `LuaTableField`.
//!
//! ## Implemented Traits
//!
//! - `Display`
//!
//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)

use crate::lcnf::*;

use super::types::LuaTableField;
use std::fmt;

impl fmt::Display for LuaTableField {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
            LuaTableField::ArrayItem(expr) => write!(f, "{}", expr),
            LuaTableField::NamedField(key, val) => write!(f, "{} = {}", key, val),
            LuaTableField::IndexedField(key, val) => write!(f, "[{}] = {}", key, val),
        }
    }
}