Skip to content

Commit 3445786

Browse files
authored
Merge pull request #1694 from sushigiri/master
Accept FnOnce instead of Fn in canvas cache draw
2 parents 98a7173 + c7d8467 commit 3445786

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

graphics/src/widget/canvas/cache.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ impl Cache {
4949
/// Otherwise, the previously stored [`Geometry`] will be returned. The
5050
/// [`Cache`] is not cleared in this case. In other words, it will keep
5151
/// returning the stored [`Geometry`] if needed.
52-
pub fn draw(&self, bounds: Size, draw_fn: impl Fn(&mut Frame)) -> Geometry {
52+
pub fn draw(
53+
&self,
54+
bounds: Size,
55+
draw_fn: impl FnOnce(&mut Frame),
56+
) -> Geometry {
5357
use std::ops::Deref;
5458

5559
if let State::Filled {

0 commit comments

Comments
 (0)