aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/util/geometry.rs4
-rw-r--r--components/util/logical_geometry.rs6
-rw-r--r--components/util/task.rs4
3 files changed, 8 insertions, 6 deletions
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<Au> = 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<T: PartialOrd + Add<T, Output=T>>(rect: Rect<T>, point: Point2D<T>) -> bool {
+pub fn rect_contains_point<T>(rect: Rect<T>, point: Point2D<T>) -> bool
+ where T: PartialOrd + Add<T, Output=T>
+{
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<T: Sub<T, Output=T>> Sub for LogicalSize<T> {
/// A 2D point in flow-relative dimensions
#[derive(PartialEq, RustcEncodable, Eq, Clone, Copy)]
pub struct LogicalPoint<T> {
- 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<F>(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.