For matrices, return the actual result of partial_clamp instead of None.

Fix #401
This commit is contained in:
sebcrozet 2018-09-24 05:58:58 +02:00 committed by Sébastien Crozet
parent 962e89417c
commit c6bc62c95f
2 changed files with 11 additions and 1 deletions

View File

@ -909,7 +909,7 @@ where
} }
} }
None first_ord
} }
#[inline] #[inline]

View File

@ -706,6 +706,16 @@ fn set_row_column() {
assert_eq!(expected2, computed); assert_eq!(expected2, computed);
} }
#[test]
fn partial_clamp() {
// NOTE: from #401.
let n = Vector2::new(1.5, 0.0);
let min = Vector2::new(-75.0, -0.0);
let max = Vector2::new(75.0, 0.0);
let inter = na::partial_clamp(&n, &min, &max);
assert_eq!(*inter.unwrap(), n);
}
#[cfg(feature = "arbitrary")] #[cfg(feature = "arbitrary")]
mod transposition_tests { mod transposition_tests {
use super::*; use super::*;