Skip to content

Commit

Permalink
Merge pull request #1694 from sushigiri/master
Browse files Browse the repository at this point in the history
Accept FnOnce instead of Fn in canvas cache draw
  • Loading branch information
hecrj authored Feb 6, 2023
2 parents 98a7173 + c7d8467 commit 3445786
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion graphics/src/widget/canvas/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ impl Cache {
/// Otherwise, the previously stored [`Geometry`] will be returned. The
/// [`Cache`] is not cleared in this case. In other words, it will keep
/// returning the stored [`Geometry`] if needed.
pub fn draw(&self, bounds: Size, draw_fn: impl Fn(&mut Frame)) -> Geometry {
pub fn draw(
&self,
bounds: Size,
draw_fn: impl FnOnce(&mut Frame),
) -> Geometry {
use std::ops::Deref;

if let State::Filled {
Expand Down

0 comments on commit 3445786

Please sign in to comment.