Skip to content

Commit e962dd9

Browse files
committed
fix doctests
1 parent 90b5784 commit e962dd9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/alloc/src/option.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,10 @@ impl<T: ?Sized> Option<&T> {
522522
/// # Examples
523523
///
524524
/// ```
525+
/// #![feature(option_owned)]
526+
///
525527
/// let s = "string";
526-
/// let opt_s: Option<&str> = Some(x);
528+
/// let opt_s: Option<&str> = Some(s);
527529
/// assert_eq!(opt_s, Some("string"));
528530
/// let owned: Option<String> = opt_s.owned();
529531
/// assert_eq!(owned, Some(String::from("string")));
@@ -556,8 +558,10 @@ impl<T: ?Sized> Option<&mut T> {
556558
/// # Examples
557559
///
558560
/// ```
561+
/// #![feature(option_owned)]
562+
///
559563
/// let s = "string";
560-
/// let opt_s: Option<&str> = Some(x);
564+
/// let opt_s: Option<&str> = Some(s);
561565
/// assert_eq!(opt_s, Some("string"));
562566
/// let owned: Option<String> = opt_s.owned();
563567
/// assert_eq!(owned, Some(String::from("string")));

0 commit comments

Comments
 (0)