From d20ef3b6d886bfd1634cbd5979240e1bc6eee975 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 23 Oct 2015 10:35:11 +0200 Subject: [PATCH 1/3] Use a where clause for rect_contains_point to bring the line under 100 columns. --- components/util/geometry.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } From cfc80582c82553d46078d2f2e06db33c34f4def8 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 23 Oct 2015 10:35:35 +0200 Subject: [PATCH 2/3] Associate documentation comments for LogicalPoint's fields with the correct field. --- components/util/logical_geometry.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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, } From 4297a4443538ee2638111b0c59afa5c7f6fb8830 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 23 Oct 2015 10:35:58 +0200 Subject: [PATCH 3/3] Remove a pointless closure from spawn_named. --- components/util/task.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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.