Repository navigation
Conversation
|
Huh, I haven't seen any interest in I see you store I'm not a big fan of APIT. Perhaps instead use |
I'm not following. Are you suggesting doing |
|
What happens with the current code in your PR? I guess it requires |
|
With my PR, the closure itself can only hold things by value and not by reference, but the closure will be deleted when the |
|
Your PR accepts |
|
I don't get it. With my PR, you can do something like: let at_start = now();
let rng = JitterRng::new_with_timer(move || { now() - at_start });You cannot do that right now and you cannot do if you have to pass a |
|
You're right, a closure can contain read-only data (including allocations since |
|
Your PR introduces a dependency on One option might be to feature-gate What is your use-case, if you don't mind me asking? |
|
What about just dropping the |
Turns
JitterRng::new_with_timer(fn() -> u64)intonew_with_timer(impl Fn() -> u64).This allows passing a closure to this function, and to properly manage ownership.
I don't generally know what the opinion about this change would be, but I thought I'd just open a PR and see.