media icon indicating copy to clipboard operation
media copied to clipboard

No need to use `boxfnonce`

Open ferjm opened this issue 7 years ago • 0 comments

<nox> Manishearth, ferjm: IMO we don't need boxfnonce, I did something similar for tasks in the script crate and it helped me quite a bit to make my own trait with a name specific to my domain (i.e. tasks).
<nox> Manishearth, ferjm: I.e. https://github.com/servo/media/blob/14de1191e3ee075c1295f8cc468208a815be8eb1/audio/src/node.rs#L192 this could be a trait which convey more information about what it is, with an impl for Box<F> where F: FnOnce.
<nox> Note that for the script tasks, I ended up having two traits anyway, TaskOnce and TaskBox, because if you try to compose the boxed ones directly you end up with multiple layers of boxing.

ferjm avatar Sep 20 '18 12:09 ferjm