Skip to content

Commit

Permalink
Rollup merge of rust-lang#134032 - snprajwal:fix-docs, r=joboet
Browse files Browse the repository at this point in the history
docs: better examples for `std::ops::ControlFlow`

Fixes rust-lang#133963. Lesson learnt, never force-push from a bare clone of a repo 💀
  • Loading branch information
fmease authored Dec 9, 2024
2 parents 780b5bb + 477b722 commit e0f3db0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
/// use std::ops::ControlFlow;
///
/// assert!(ControlFlow::<i32, String>::Break(3).is_break());
/// assert!(!ControlFlow::<String, i32>::Continue(3).is_break());
/// assert!(ControlFlow::<&str, i32>::Break("Stop right there!").is_break());
/// assert!(!ControlFlow::<&str, i32>::Continue(3).is_break());
/// ```
#[inline]
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
Expand All @@ -157,8 +157,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
/// use std::ops::ControlFlow;
///
/// assert!(!ControlFlow::<i32, String>::Break(3).is_continue());
/// assert!(ControlFlow::<String, i32>::Continue(3).is_continue());
/// assert!(!ControlFlow::<&str, i32>::Break("Stop right there!").is_continue());
/// assert!(ControlFlow::<&str, i32>::Continue(3).is_continue());
/// ```
#[inline]
#[stable(feature = "control_flow_enum_is", since = "1.59.0")]
Expand All @@ -174,8 +174,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
/// use std::ops::ControlFlow;
///
/// assert_eq!(ControlFlow::<i32, String>::Break(3).break_value(), Some(3));
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).break_value(), None);
/// assert_eq!(ControlFlow::<&str, i32>::Break("Stop right there!").break_value(), Some("Stop right there!"));
/// assert_eq!(ControlFlow::<&str, i32>::Continue(3).break_value(), None);
/// ```
#[inline]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
Expand Down Expand Up @@ -205,8 +205,8 @@ impl<B, C> ControlFlow<B, C> {
/// ```
/// use std::ops::ControlFlow;
///
/// assert_eq!(ControlFlow::<i32, String>::Break(3).continue_value(), None);
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).continue_value(), Some(3));
/// assert_eq!(ControlFlow::<&str, i32>::Break("Stop right there!").continue_value(), None);
/// assert_eq!(ControlFlow::<&str, i32>::Continue(3).continue_value(), Some(3));
/// ```
#[inline]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
Expand Down

0 comments on commit e0f3db0

Please sign in to comment.