diff --git a/src/lib.rs b/src/lib.rs index fbc0a27d..68116334 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -188,7 +188,9 @@ pub fn zero() -> T { /// The range must not be empty. #[inline] pub fn wrap(mut val: T, min: T, max: T) -> T -where T: Copy + PartialOrd + ClosedAdd + ClosedSub { +where + T: Copy + PartialOrd + ClosedAdd + ClosedSub, +{ assert!(min < max, "Invalid wrapping bounds."); let width = max - min; @@ -388,7 +390,9 @@ pub fn partial_sort2<'a, T: PartialOrd>(a: &'a T, b: &'a T) -> Option<(&'a T, &' /// * [distance_squared](fn.distance_squared.html) #[inline] pub fn center(p1: &Point, p2: &Point) -> Point -where DefaultAllocator: Allocator { +where + DefaultAllocator: Allocator, +{ ((&p1.coords + &p2.coords) * convert::<_, N>(0.5)).into() }