Skip to content

Commit e3384e0

Browse files
authored
fix types in to_owned doctest
1 parent 025c328 commit e3384e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcollections/borrow.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ pub trait ToOwned {
5252
/// Basic usage:
5353
///
5454
/// ```
55-
/// let s = "a"; // &str
56-
/// let ss = s.to_owned(); // String
55+
/// let s: &str = "a";
56+
/// let ss: String = s.to_owned();
5757
///
58-
/// let v = &[1, 2]; // slice
59-
/// let vv = v.to_owned(); // Vec
58+
/// let v: &[i32] = &[1, 2];
59+
/// let vv: Vec<i32> = v.to_owned();
6060
/// ```
6161
#[stable(feature = "rust1", since = "1.0.0")]
6262
fn to_owned(&self) -> Self::Owned;

0 commit comments

Comments
 (0)