diff options
author | 2023-02-06 21:24:45 +0100 | |
---|---|---|
committer | 2023-02-06 21:24:45 +0100 | |
commit | 344578649ebcfe60d6a4010d743e68a423942e06 (patch) | |
tree | d4b9edcea30bcf858ea2638d5fe1f2c561860d2e /graphics | |
parent | 98a717383acf71d7939d7cc90d350743487f0380 (diff) | |
parent | c7d8467c46e519b28f8f630061e7d55fb3cd3f8b (diff) | |
download | iced-344578649ebcfe60d6a4010d743e68a423942e06.tar.gz iced-344578649ebcfe60d6a4010d743e68a423942e06.tar.bz2 iced-344578649ebcfe60d6a4010d743e68a423942e06.zip |
Merge pull request #1694 from sushigiri/master
Accept FnOnce instead of Fn in canvas cache draw
Diffstat (limited to '')
-rw-r--r-- | graphics/src/widget/canvas/cache.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics/src/widget/canvas/cache.rs b/graphics/src/widget/canvas/cache.rs index 49873ac9..52217bbb 100644 --- a/graphics/src/widget/canvas/cache.rs +++ b/graphics/src/widget/canvas/cache.rs @@ -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 { |