castep-cell-io 0.2.9

A crate helping to parse, edit and save `castep` input file format `.cell`
Documentation
use std::fmt::Display;

use crate::cell_document::params::options::OptionDisplay;

#[derive(Debug, Default, Clone, Copy)]
pub enum OptStrategy {
    Default,
    #[default]
    Speed,
    Memory,
}

impl Display for OptStrategy {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        write!(f, "{}", self.output())
    }
}

impl OptionDisplay for OptStrategy {
    fn tag(&self) -> String {
        "opt_strategy".to_string()
    }

    fn value(&self) -> String {
        match self {
            Self::Default => "Default".to_string(),
            Self::Speed => "Speed".to_string(),
            Self::Memory => "Memory".to_string(),
        }
    }
}