Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
lovasoa committed Jul 8, 2019
1 parent f6be585 commit c5652dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![type_length_limit="1814752"]

/// Content-preserving image resizing
///
/// See: [resize]
Expand Down
20 changes: 9 additions & 11 deletions src/pos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@ impl Pos {
let Pos(x, y) = self;
once(y + 1)
.filter(move |&y| y < height)
.flat_map(move |y| once(x.checked_sub(1))
.flatten()
.chain(once(x))
.chain(once(x + 1)
.filter(move |&x| x < width)
)
.map(move |x| Pos(x, y)))
.flat_map(move |y|
x.checked_sub(1).into_iter()
.chain(once(x))
.chain(once(x + 1)
.filter(move |&x| x < width)
)
.map(move |x| Pos(x, y)))
}

pub fn predecessors(self, size: Pos)
-> impl Iterator<Item=Pos> {
let Pos(x, y) = self;
once(y)
.flat_map(|y| y.checked_sub(1))
y.checked_sub(1).into_iter()
.flat_map(move |y|
once(x.checked_sub(1))
.flatten()
x.checked_sub(1).into_iter()
.chain(once(x))
.chain(once(x + 1)
.filter(move |&x| x < size.0)
Expand Down

0 comments on commit c5652dd

Please sign in to comment.