You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think some of the finesse is removed when C=() is no longer allowed?
This is very true. In any case, we can get rid of control::Control by making use of std::ops::ControlFlow<B, ()>. I'll make a PR to see how it looks like.
I think some of the finesse is removed when C=() is no longer allowed?
On a second thought, even forcing the usage of std::ops::ControlFlow as the output of every closure would not remove any finesse (one could return std::ops::Continue(()) forever), but would severely hurt ergonomics (e.g., functions returning Result<(), E> would have to be wrapped, etc.).
Even using std::ops::Try (when it stabilizes) would disallow C = () (as () is currently not std::ops::Try). So #11 might be a nice middle ground, swapping control::Control for std::ops::ControlFlow, but still as an implementation of control::Control trait.
This (in fact the whole file)
permutohedron/src/control.rs
Lines 13 to 20 in afdb943
could be swapped with std::ops::ControlFlow, available since Rust 1.55.0.
But signatures like
permutohedron/src/lib.rs
Lines 44 to 46 in afdb943
would become (something like)
or maybe even
since std::ops::Try is not yet stable (rust-lang/rust#84277); that would be a breaking change.
What do you think @bluss?
The text was updated successfully, but these errors were encountered: