Skip to content

Commit

Permalink
fix doc-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ripytide committed May 30, 2024
1 parent c67424a commit 2a48576
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ pub trait RectExt {
///
/// # Examples
/// ```
/// use imageproc::rect::Rect;
/// use imageproc::rect::Region;
/// use imageproc::rect::{Rect, RectExt};
///
/// // Intersecting a rectangle with itself
/// let r = Rect{x: 4, y: 5, width: 6, height: 7};
/// assert_eq!(r.intersect(r), Some(r));
/// assert_eq!(r.intersect(&r), Some(r));
///
/// // Intersecting overlapping but non-equal rectangles
/// let r = Rect{x: 0, y: 0, width:5, height:5};
/// let s = Rect{x: 1, y: 4, width:10, height: 2};
/// let i = Rect{x: 1, y: 4, width:4, height:1};
/// assert_eq!(r.intersect(s), Some(i));
/// assert_eq!(r.intersect(&s), Some(i));
///
/// // Intersecting disjoint rectangles
/// let r = Rect{x: 0, y: 0, width:5, height:5};
/// let s = Rect{x: 10, y: 10, width: 100, height: 12};
/// assert_eq!(r.intersect(s), None);
/// assert_eq!(r.intersect(&s), None);
/// ```
fn intersect(&self, other: &Self) -> Option<Self>
where
Expand Down

0 comments on commit 2a48576

Please sign in to comment.