mirror of https://github.com/rm-dr/daisy
Minor cleanup
parent
682205f5e1
commit
8497c125ef
|
@ -61,7 +61,7 @@ impl Config {
|
|||
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Clone)]
|
||||
//#[derive(Clone)]
|
||||
pub struct Context {
|
||||
pub config: Config,
|
||||
|
||||
|
@ -81,7 +81,7 @@ impl Context {
|
|||
history: Vec::new(),
|
||||
variables: HashMap::new(),
|
||||
functions: HashMap::new(),
|
||||
shadow: HashMap::new(),
|
||||
shadow: HashMap::new()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -164,7 +164,8 @@ pub fn eval_operator(context: &mut Context, g: &Expression) -> Result<Option<Exp
|
|||
|
||||
if let Expression::Quantity(la, a) = a {
|
||||
if let Expression::Quantity(lb, b) = b {
|
||||
return Ok(Some(Expression::Quantity(*la + *lb + *op_loc, a.clone() * b.clone())));
|
||||
let o = a.clone() * b.clone();
|
||||
return Ok(Some(Expression::Quantity(*la + *lb + *op_loc, o)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -275,7 +275,6 @@ impl Unit {
|
|||
let mut q = Quantity::new_rational(1f64).unwrap();
|
||||
q.set_unit(b);
|
||||
return Some(q);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue