aboutsummaryrefslogtreecommitdiff
path: root/src/operation.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-01-18 18:29:10 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2024-01-18 18:29:10 +0100
commit1713618d4cc0194674f91fd2d24ef2de88f21784 (patch)
tree1cb39a43019c071ca127cb9f609c045327798de3 /src/operation.rs
parent670c1881af4680ce7c248498528d14b98210af3f (diff)
create small iced demo
Diffstat (limited to 'src/operation.rs')
-rw-r--r--src/operation.rs32
1 files changed, 0 insertions, 32 deletions
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)),
- )*]
- };
-}