Return zero when computing distance of Option with both value is none.

This commit is contained in:
Mantaroh Yoshinaga 2017-06-14 11:03:53 +09:00
parent 849bdc958c
commit 95b272d9aa

View file

@ -853,6 +853,7 @@ impl <T> Animatable for Option<T>
(&Some(ref this), &Some(ref other)) => {
this.compute_squared_distance(other)
},
(&None, &None) => Ok(0.0),
_ => Err(()),
}
}