Rollup merge of #91091 - ecstatic-morse:control-flow-enum-is, r=m-ou-se
Stabilize `ControlFlow::{is_break, is_continue}` The type itself was stabilized in 1.55, but using it is not ergonomic without these helper functions. Stabilize them. r? rust-lang/libs-api
This commit is contained in:
commit
6227d42928
@ -141,7 +141,7 @@ impl<B, C> ControlFlow<B, C> {
|
||||
/// assert!(!ControlFlow::<String, i32>::Continue(3).is_break());
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
|
||||
pub fn is_break(&self) -> bool {
|
||||
matches!(*self, ControlFlow::Break(_))
|
||||
}
|
||||
@ -158,7 +158,7 @@ impl<B, C> ControlFlow<B, C> {
|
||||
/// assert!(ControlFlow::<String, i32>::Continue(3).is_continue());
|
||||
/// ```
|
||||
#[inline]
|
||||
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
|
||||
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
|
||||
pub fn is_continue(&self) -> bool {
|
||||
matches!(*self, ControlFlow::Continue(_))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user