message: Add some tests
  They all pass. I removed the intersect method, since I couldn't get it to pass and it didn't seem particularly useful to me...
diff: pub use nalgebra as na;
  -use std::cmp::{ min, max };
  /// A 2 dimensional point representing a location
  pub type Point2 = na::Point2<f32>;
  @@ -135,27 +134,6 @@ impl Rect {
  self.w *= sx;
  self.h *= sy;
  }
  -
  - /// Finds the intersection between two `Rect`s, or `None` iff
  - /// they don't intersect.
  - pub fn intersect(&self, other: &Rect) -> Option<Rect> {
  - if !self.overlaps(other) {
  - None
  - } else {
  - let a = (self.left().max(other.left()), self.top().max(other.top()));
  - let b = (self.right().min(other.right()), self.bottom().min(other.bottom()));
  -
  - let width = (a.0 - b.0).abs();
  - let height = (a.1 - b.1).abs();
  -
  - Some(Rect::new(
  - a.0 + width / 2.0,
  - a.1 + height / 2.0,
  - width,
  - height,
  - ))
  - }
  - }
  }
  @@ -361,4 +339,45 @@ mod tests {
  let r2 = Rect::fraction(32.0, 32.0, 32.0, 32.0, &r1);
  assert_eq!(r2, Rect::new(0.25, 0.25, 0.25, 0.25));
  }
  +
  + #[test]
  + fn test_rect_contains() {
  + let r = Rect::new(0.0, 0.0, 128.0, 128.0);
  + let p = Point2::new(0.0, 0.0);
  + assert!(r.contains(&p));
  +
  + let p = Point2::new(500.0, 0.0);
  + assert!(!r.contains(&p));
  + }
  +
  + #[test]
  + fn test_rect_overlaps() {
  + let r1 = Rect::new(0.0, 0.0, 128.0, 128.0);
  + let r2 = Rect::new(0.0, 0.0, 64.0, 64.0);
  + assert!(r1.overlaps(&r2));
  +
  + let r2 = Rect::new(100.0, 0.0, 128.0, 128.0);
  + assert!(r1.overlaps(&r2));
  +
  + let r2 = Rect::new(500.0, 0.0, 64.0, 64.0);
  + assert!(!r1.overlaps(&r2));
  + }
  +
  + #[test]
  + fn test_rect_transform() {
  + let mut r1 = Rect::new(0.0, 0.0, 64.0, 64.0);
  + let r2 = Rect::new(64.0, 64.0, 64.0, 64.0);
  + r1.translate(64.0, 64.0);
  + assert!(r1 == r2);
  +
  + let mut r1 = Rect::new(0.0, 0.0, 64.0, 64.0);
  + let r2 = Rect::new(0.0, 0.0, 128.0, 128.0);
  + r1.scale(2.0, 2.0);
  + assert!(r1 == r2);
  +
  + let mut r1 = Rect::new(32.0, 32.0, 64.0, 64.0);
  + let r2 = Rect::new(64.0, 64.0, 64.0, 64.0);
  + r1.move_to(64.0, 64.0);
  + assert!(r1 == r2);
  + }
  }
  