From 1713618d4cc0194674f91fd2d24ef2de88f21784 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 18 Jan 2024 18:29:10 +0100 Subject: create small iced demo --- src/operation.rs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/operation.rs (limited to 'src/operation.rs') diff --git a/src/operation.rs b/src/operation.rs deleted file mode 100644 index 7eca774..0000000 --- a/src/operation.rs +++ /dev/null @@ -1,32 +0,0 @@ -use crate::complex::Complex; - -pub type Operator = fn(Complex, Complex) -> Complex; - -#[derive(Clone)] -pub struct Operation { - sign: char, - func: Operator -} - -impl Operation { - pub fn new(sign: char, func: Operator) -> Self { - Self { sign, func } - } - - pub fn sign(&self) -> char { - self.sign - } - - pub fn evaluate(&self, a: Complex, b: Complex) -> Complex { - (self.func)(a, b) - } -} - -#[macro_export] -macro_rules! operations { - {$($x:expr => $y:expr), *} => { - vec![$( - Operation::new($x, Box::new($y)), - )*] - }; -} -- cgit v1.2.3-70-g09d2