From 9d4b486b845c7d04691801f1151219b41b7c327b Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 15:36:50 -0400 Subject: [PATCH 1/8] Modify Lines' description --- src/libcore/str/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 857eeb26af0..e995b59a145 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1161,9 +1161,13 @@ generate_pattern_iterators! { delegate double ended; } -/// Created with the method [`lines`]. +/// An iterator over the lines of a string, as string slices. /// -/// [`lines`]: ../../std/primitive.str.html#method.lines +/// This struct is created with the [`lines()`] method on [`str`]. +/// See its documentation for more. +/// +/// [`lines()`]: ../../std/primitive.str.html#method.lines +/// [`str`]: ../../std/primitive.str.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone, Debug)] pub struct Lines<'a>(Map, LinesAnyMap>); From 0f5cf54246f7a68a8fc18ee41dffc7cdf866e19c Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 15:40:05 -0400 Subject: [PATCH 2/8] Modify Bytes' description --- src/libcore/str/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index e995b59a145..4556d41dd0a 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -625,12 +625,13 @@ impl<'a> CharIndices<'a> { } } -/// External iterator for a string's bytes. -/// Use with the `std::iter` module. +/// An iterator over the bytes of a string slice. /// -/// Created with the method [`bytes`]. +/// This struct is created by the [`bytes()`] method on [`str`]. +/// See its documentation for more. /// -/// [`bytes`]: ../../std/primitive.str.html#method.bytes +/// [`bytes()`]: ../../std/primitive.str.html#method.bytes +/// [`str`]: ../../std/primitive.str.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone, Debug)] pub struct Bytes<'a>(Cloned>); From 41e04985867e04b2be7b7fbd90864e5d9b3a276f Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 15:46:41 -0400 Subject: [PATCH 3/8] Modify CharIndices' description --- src/libcore/str/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 4556d41dd0a..4720c965c57 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -553,7 +553,15 @@ impl<'a> Chars<'a> { } } -/// Iterator for a string's characters and their byte offsets. +/// An iterator over the [`char`]s of a string slice, and their positions. +/// +/// [`char`]: ../../std/primitive.char.html +/// +/// This struct is created by the [`char_indices()`] method on [`str`]. +/// See its documentation for more. +/// +/// [`char_indices()`]: ../../std/primitive.str.html#method.char_indices +/// [`str`]: ../../std/primitive.str.html #[derive(Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct CharIndices<'a> { From 17b4884d3c3d88af7f43d5fca32fd8f48d75669b Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 15:51:49 -0400 Subject: [PATCH 4/8] Modify Chars' description --- src/libcore/str/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 4720c965c57..11d52e3c15b 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -369,11 +369,15 @@ impl fmt::Display for Utf8Error { Section: Iterators */ -/// Iterator for the char (representing *Unicode Scalar Values*) of a string. +/// An iterator over the [`char`]s of a string slice. /// -/// Created with the method [`chars`]. +/// [`char`]: ../../std/primitive.char.html /// -/// [`chars`]: ../../std/primitive.str.html#method.chars +/// This struct is created by the [`chars()`] method on [`str`]. +/// See its documentation for more. +/// +/// [`chars()`]: ../../std/primitive.str.html#method.chars +/// [`str`]: ../../std/primitive.str.html #[derive(Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Chars<'a> { From 5d14ccbc96923607f6ab00810817885ee0939486 Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 16:35:19 -0400 Subject: [PATCH 5/8] Modify EncodeUtf16's description --- src/libcollections/str.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 219e818f7d7..aee6861a09f 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -133,9 +133,15 @@ impl> SliceConcatExt for [S] { } } -/// External iterator for a string's UTF-16 code units. +/// An iterator of [`u16`] over the string encoded as UTF-16. /// -/// For use with the `std::iter` module. +/// [`u16`]: ../../std/primitive.u16.html +/// +/// This struct is created by the [`encode_utf16()`] method on [`str`]. +/// See its documentation for more. +/// +/// [`encode_utf16()`]: ../../std/primitive.str.html#method.encode_utf16 +/// [`str`]: ../../std/primitive.str.html #[derive(Clone)] #[stable(feature = "encode_utf16", since = "1.8.0")] pub struct EncodeUtf16<'a> { From a4a7166fd585802e9644ae9b4aa3e63861d11d3e Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 16:36:06 -0400 Subject: [PATCH 6/8] Modify SplitWhitespace's description --- src/libstd_unicode/u_str.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libstd_unicode/u_str.rs b/src/libstd_unicode/u_str.rs index 3c02ea82d2a..fd309e822a0 100644 --- a/src/libstd_unicode/u_str.rs +++ b/src/libstd_unicode/u_str.rs @@ -17,8 +17,13 @@ use core::char; use core::iter::{Filter, FusedIterator}; use core::str::Split; -/// An iterator over the non-whitespace substrings of a string, -/// separated by any amount of whitespace. +/// An iterator over sub-slices of the original string slice. +/// +/// This struct is created by the [`split_whitespace()`] method on [`str`]. +/// See its documentation for more. +/// +/// [`split_whitespace()`]: ../../std/primitive.str.html#method.split_whitespace +/// [`str`]: ../../std/primitive.str.html #[stable(feature = "split_whitespace", since = "1.1.0")] pub struct SplitWhitespace<'a> { inner: Filter bool>, fn(&&str) -> bool>, From c4b11d19b85f970b759f14e6dd864512d8c41f66 Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 16:46:16 -0400 Subject: [PATCH 7/8] Revert SplitWhitespace's description Original headline of SplitWhitespace's description is more descriptive as to what it contains and iterates over. --- src/libstd_unicode/u_str.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstd_unicode/u_str.rs b/src/libstd_unicode/u_str.rs index fd309e822a0..d3aa27b436d 100644 --- a/src/libstd_unicode/u_str.rs +++ b/src/libstd_unicode/u_str.rs @@ -17,7 +17,8 @@ use core::char; use core::iter::{Filter, FusedIterator}; use core::str::Split; -/// An iterator over sub-slices of the original string slice. +/// An iterator over the non-whitespace substrings of a string, +/// separated by any amount of whitespace. /// /// This struct is created by the [`split_whitespace()`] method on [`str`]. /// See its documentation for more. From 3b396217b5b52cf87769263bf0b842c56471b54f Mon Sep 17 00:00:00 2001 From: Donnie Bishop Date: Thu, 30 Mar 2017 18:33:23 -0400 Subject: [PATCH 8/8] Remove parentheses in method references --- src/libcollections/str.rs | 4 ++-- src/libcore/str/mod.rs | 16 ++++++++-------- src/libstd_unicode/u_str.rs | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index aee6861a09f..36a1f1eb2b7 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -137,10 +137,10 @@ impl> SliceConcatExt for [S] { /// /// [`u16`]: ../../std/primitive.u16.html /// -/// This struct is created by the [`encode_utf16()`] method on [`str`]. +/// This struct is created by the [`encode_utf16`] method on [`str`]. /// See its documentation for more. /// -/// [`encode_utf16()`]: ../../std/primitive.str.html#method.encode_utf16 +/// [`encode_utf16`]: ../../std/primitive.str.html#method.encode_utf16 /// [`str`]: ../../std/primitive.str.html #[derive(Clone)] #[stable(feature = "encode_utf16", since = "1.8.0")] diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 11d52e3c15b..56f42349b20 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -373,10 +373,10 @@ Section: Iterators /// /// [`char`]: ../../std/primitive.char.html /// -/// This struct is created by the [`chars()`] method on [`str`]. +/// This struct is created by the [`chars`] method on [`str`]. /// See its documentation for more. /// -/// [`chars()`]: ../../std/primitive.str.html#method.chars +/// [`chars`]: ../../std/primitive.str.html#method.chars /// [`str`]: ../../std/primitive.str.html #[derive(Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] @@ -561,10 +561,10 @@ impl<'a> Chars<'a> { /// /// [`char`]: ../../std/primitive.char.html /// -/// This struct is created by the [`char_indices()`] method on [`str`]. +/// This struct is created by the [`char_indices`] method on [`str`]. /// See its documentation for more. /// -/// [`char_indices()`]: ../../std/primitive.str.html#method.char_indices +/// [`char_indices`]: ../../std/primitive.str.html#method.char_indices /// [`str`]: ../../std/primitive.str.html #[derive(Clone, Debug)] #[stable(feature = "rust1", since = "1.0.0")] @@ -639,10 +639,10 @@ impl<'a> CharIndices<'a> { /// An iterator over the bytes of a string slice. /// -/// This struct is created by the [`bytes()`] method on [`str`]. +/// This struct is created by the [`bytes`] method on [`str`]. /// See its documentation for more. /// -/// [`bytes()`]: ../../std/primitive.str.html#method.bytes +/// [`bytes`]: ../../std/primitive.str.html#method.bytes /// [`str`]: ../../std/primitive.str.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone, Debug)] @@ -1176,10 +1176,10 @@ generate_pattern_iterators! { /// An iterator over the lines of a string, as string slices. /// -/// This struct is created with the [`lines()`] method on [`str`]. +/// This struct is created with the [`lines`] method on [`str`]. /// See its documentation for more. /// -/// [`lines()`]: ../../std/primitive.str.html#method.lines +/// [`lines`]: ../../std/primitive.str.html#method.lines /// [`str`]: ../../std/primitive.str.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Clone, Debug)] diff --git a/src/libstd_unicode/u_str.rs b/src/libstd_unicode/u_str.rs index d3aa27b436d..770b67acd49 100644 --- a/src/libstd_unicode/u_str.rs +++ b/src/libstd_unicode/u_str.rs @@ -20,10 +20,10 @@ use core::str::Split; /// An iterator over the non-whitespace substrings of a string, /// separated by any amount of whitespace. /// -/// This struct is created by the [`split_whitespace()`] method on [`str`]. +/// This struct is created by the [`split_whitespace`] method on [`str`]. /// See its documentation for more. /// -/// [`split_whitespace()`]: ../../std/primitive.str.html#method.split_whitespace +/// [`split_whitespace`]: ../../std/primitive.str.html#method.split_whitespace /// [`str`]: ../../std/primitive.str.html #[stable(feature = "split_whitespace", since = "1.1.0")] pub struct SplitWhitespace<'a> {