diff options
Diffstat (limited to 'src/operation.rs')
| -rw-r--r-- | src/operation.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/operation.rs b/src/operation.rs index a61ae1f..7eca774 100644 --- a/src/operation.rs +++ b/src/operation.rs @@ -1,14 +1,15 @@ use crate::complex::Complex; -pub type Operator = dyn Fn(Complex, Complex) -> Complex; +pub type Operator = fn(Complex, Complex) -> Complex; +#[derive(Clone)] pub struct Operation { sign: char, - func: Box<Operator> + func: Operator } impl Operation { - pub fn new(sign: char, func: Box<Operator>) -> Self { + pub fn new(sign: char, func: Operator) -> Self { Self { sign, func } } |