GregoryConrad / rearch-rs

Re-imagined approach to application design and architecture
https://crates.io/crates/rearch
MIT License
81 stars 4 forks source link

Experiment with limiting some clones involved with `FnOnce` callbacks #38

Closed GregoryConrad closed 5 months ago

GregoryConrad commented 6 months ago

Since some FnOnces are called within the function they are passed as an argument to, we should be able to limit the lifetime of variables they capture and thus remove the need to clone in some situations. I am thinking we can just introduce a lifetime like https://doc.rust-lang.org/std/thread/fn.scope.html does which will prevent the need to clone