未验证 提交 c51903c7 编写于 作者: K kennytm

Rollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton

docs: minor stylistic changes to str/string docs

std::string::String.repeat(): slightly rephrase to be more in-line with other descriptions.

add ticks around a few keywords in other descriptions.
......@@ -513,7 +513,7 @@ pub fn into_string(self: Box<str>) -> String {
unsafe { String::from_utf8_unchecked(slice.into_vec()) }
}
/// Create a [`String`] by repeating a string `n` times.
/// Creates a new [`String`] by repeating a string `n` times.
///
/// [`String`]: string/struct.String.html
///
......
......@@ -752,7 +752,7 @@ pub fn into_bytes(self) -> Vec<u8> {
self.vec
}
/// Extracts a string slice containing the entire string.
/// Extracts a string slice containing the entire `String`.
///
/// # Examples
///
......@@ -1454,8 +1454,8 @@ pub fn clear(&mut self) {
self.vec.clear()
}
/// Creates a draining iterator that removes the specified range in the string
/// and yields the removed chars.
/// Creates a draining iterator that removes the specified range in the `String`
/// and yields the removed `chars`.
///
/// Note: The element range is removed even if the iterator is not
/// consumed until the end.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册