cli: add dev command for enums experiment

This commit is contained in:
Schrottkatze 2024-02-19 18:07:09 +01:00
parent 56ec11e143
commit db9228dec4
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
4 changed files with 43 additions and 4 deletions

View file

@ -7,7 +7,7 @@ use experimental::enum_based::{Instruction, PipelineBuilder};
/// just some experiments, to test whether the architecture i want is even possible (or how to do it). probably temporary.
/// Gonna first try string processing...
mod experimental {
pub mod experimental {
pub mod enum_based {
pub enum Instruction {
Uppercase,
@ -41,6 +41,7 @@ mod experimental {
}
}
#[must_use]
pub fn insert(mut self, instr: Instruction) -> Self {
self.pipeline.push(instr);
self
@ -66,6 +67,12 @@ mod experimental {
Pipeline { pipeline: res }
}
}
impl Default for PipelineBuilder {
fn default() -> Self {
Self::new()
}
}
}
}