diff --git a/components/util/geometry.rs b/components/util/geometry.rs index 224f301141d..c2f08f7cd8d 100644 --- a/components/util/geometry.rs +++ b/components/util/geometry.rs @@ -89,7 +89,9 @@ pub static MAX_RECT: Rect = Rect { /// Returns true if the rect contains the given point. Points on the top or left sides of the rect /// are considered inside the rectangle, while points on the right or bottom sides of the rect are /// not considered inside the rectangle. -pub fn rect_contains_point>(rect: Rect, point: Point2D) -> bool { +pub fn rect_contains_point(rect: Rect, point: Point2D) -> bool + where T: PartialOrd + Add +{ point.x >= rect.origin.x && point.x < rect.origin.x + rect.size.width && point.y >= rect.origin.y && point.y < rect.origin.y + rect.size.height } diff --git a/components/util/logical_geometry.rs b/components/util/logical_geometry.rs index 7eac6e82802..354bf033e08 100644 --- a/components/util/logical_geometry.rs +++ b/components/util/logical_geometry.rs @@ -319,8 +319,10 @@ impl> Sub for LogicalSize { /// A 2D point in flow-relative dimensions #[derive(PartialEq, RustcEncodable, Eq, Clone, Copy)] pub struct LogicalPoint { - pub i: T, /// inline-axis coordinate - pub b: T, /// block-axis coordinate + /// inline-axis coordinate + pub i: T, + /// block-axis coordinate + pub b: T, debug_writing_mode: DebugWritingMode, } diff --git a/components/util/task.rs b/components/util/task.rs index 0da712f5d06..2495bb8acd5 100644 --- a/components/util/task.rs +++ b/components/util/task.rs @@ -12,9 +12,7 @@ pub fn spawn_named(name: String, f: F) where F: FnOnce() + Send + 'static { let builder = thread::Builder::new().name(name); - builder.spawn(move || { - f() - }).unwrap(); + builder.spawn(f).unwrap(); } /// Arrange to send a particular message to a channel if the task fails.