-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
This (in fact the whole file)
Lines 13 to 20 in afdb943
| /// Control flow for callbacks. | |
| /// | |
| /// `Break` can carry a value. | |
| #[derive(Copy, Clone, Debug)] | |
| pub enum Control<B> { | |
| Continue, | |
| Break(B), | |
| } |
could be swapped with std::ops::ControlFlow, available since Rust 1.55.0.
But signatures like
Lines 44 to 46 in afdb943
| pub fn heap_recursive<T, F, C>(xs: &mut [T], mut f: F) -> C | |
| where F: FnMut(&mut [T]) -> C, | |
| C: ControlFlow, |
would become (something like)
pub fn heap_recursive<T, F, B, C>(xs: &mut [T], mut f: F) -> std::ops::ControlFlow<B, C>
where F: FnMut(&mut [T]) -> std::ops::ControlFlow<B, C>,or maybe even
pub fn heap_recursive<T, F, B, C>(xs: &mut [T], mut f: F) -> Result<C, B>
where F: FnMut(&mut [T]) -> std::ops::ControlFlow<B, C>,since std::ops::Try is not yet stable (rust-lang/rust#84277); that would be a breaking change.
What do you think @bluss?
Metadata
Metadata
Assignees
Labels
No labels