File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -522,8 +522,10 @@ impl<T: ?Sized> Option<&T> {
522
522
/// # Examples
523
523
///
524
524
/// ```
525
+ /// #![feature(option_owned)]
526
+ ///
525
527
/// let s = "string";
526
- /// let opt_s: Option<&str> = Some(x );
528
+ /// let opt_s: Option<&str> = Some(s );
527
529
/// assert_eq!(opt_s, Some("string"));
528
530
/// let owned: Option<String> = opt_s.owned();
529
531
/// assert_eq!(owned, Some(String::from("string")));
@@ -556,8 +558,10 @@ impl<T: ?Sized> Option<&mut T> {
556
558
/// # Examples
557
559
///
558
560
/// ```
561
+ /// #![feature(option_owned)]
562
+ ///
559
563
/// let s = "string";
560
- /// let opt_s: Option<&str> = Some(x );
564
+ /// let opt_s: Option<&str> = Some(s );
561
565
/// assert_eq!(opt_s, Some("string"));
562
566
/// let owned: Option<String> = opt_s.owned();
563
567
/// assert_eq!(owned, Some(String::from("string")));
You can’t perform that action at this time.
0 commit comments