iced icon indicating copy to clipboard operation
iced copied to clipboard

Why not use `FnOnce` rather than `Fn` in `Cache::draw`?

Open YdrMaster opened this issue 3 years ago • 0 comments

Hello, I'm sorry about my broken English. So let me ask the question directly. In file cache.rs, the method draw use a impl Fn(&mut Frame) as its parameter:

pub fn draw(&self, bounds: Size, draw_fn: impl Fn(&mut Frame)) -> Geometry

So, I can't move a iterator into the closure and have to collect the iterator before calling draw method. I wonder why not just use a FnOnce?

YdrMaster avatar Nov 15 '21 15:11 YdrMaster