@@ -816,15 +816,15 @@ mod loop_keyword { }
816816/// be handled exhaustively either explicitly or by using wildcards like
817817/// `_` in the `match`. Since `match` is an expression values can also be
818818/// returned.
819- ///
819+ ///
820820/// ```rust
821821/// let opt = Option::None::<usize>;
822822/// let x = match opt {
823823/// Some(int) => int,
824824/// None => 10,
825825/// }
826826/// assert_eq!(x, 10);
827- ///
827+ ///
828828/// let a_number = Option::Some(10);
829829/// match a_number {
830830/// Some(x) if x <= 5 => println!("0 to 5 num = {}", x),
@@ -833,27 +833,27 @@ mod loop_keyword { }
833833/// _ => all_other_numbers(),
834834/// }
835835/// ```
836- ///
837- /// `match` can be used to gain access to the inner members of an enum
836+ ///
837+ /// `match` can be used to gain access to the inner members of an enum
838838/// and use them directly.
839- ///
839+ ///
840840/// ```rust
841841/// enum Outer {
842842/// Double(Option<u8>, Option<String>),
843843/// Single(Option<u8>),
844844/// Empty
845845/// }
846- ///
846+ ///
847847/// let get_inner = Outer::Double(None, Some(String::new()));
848848/// match get_inner {
849849/// Outer::Double(None, Some(st)) => println!("{}", st),
850850/// Outer::Single(opt) => println!("{:?}", opt),
851851/// _ => the_rest(),
852852/// }
853853/// ```
854- ///
854+ ///
855855/// For more information on `match` and matching in general, see the [Reference].
856- ///
856+ ///
857857/// [Reference]: ../reference/expressions/match-expr.html
858858mod match_keyword { }
859859
@@ -874,29 +874,29 @@ mod mod_keyword { }
874874/// `move` converts any variables captured by reference or mutable reference
875875/// to owned by value variables. The three [`Fn` trait]'s mirror the ways to capture
876876/// variables, when `move` is used the closures is represented by the `FnOnce` trait.
877- ///
877+ ///
878878/// ```rust
879879/// let capture = "hello";
880880/// let closure = move || {
881881/// println!("we say {}", capture);
882882/// };
883883/// ```
884- ///
884+ ///
885885/// `move` is often used when [threads] are involved.
886- ///
886+ ///
887887/// ```rust
888888/// let x = 5;
889- ///
889+ ///
890890/// std::thread::spawn(move || {
891891/// println!("captured {} by value", x)
892892/// }).join().unwrap();
893- ///
893+ ///
894894/// // x is no longer available
895895/// ```
896- ///
896+ ///
897897/// For more information on the `move` keyword, see the [closure]'s section
898898/// of the Rust book or the [threads] section
899- ///
899+ ///
900900/// [`Fn` trait]: ../std/ops/trait.Fn.html
901901/// [closure]: ../book/ch13-01-closures.html
902902/// [threads]: ../book/ch16-01-threads.html#using-move-closures-with-threads
0 commit comments