diff options
| author | bors <bors@rust-lang.org> | 2017-02-25 00:40:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-25 00:40:09 +0000 |
| commit | 7932349e95ebd9de314e5c5fce155c33940a148b (patch) | |
| tree | 2661207eb32ef57cfc5540ba31d5c3b8d5350881 /src/libcore | |
| parent | 08230775a026c955873ba557e624b7f665661f37 (diff) | |
| parent | f26bbb351051b17fd2d32f19fb4964415fe1d07b (diff) | |
| download | rust-7932349e95ebd9de314e5c5fce155c33940a148b.tar.gz rust-7932349e95ebd9de314e5c5fce155c33940a148b.zip | |
Auto merge of #40072 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests - Successful merges: #39777, #39815, #39845, #39886, #39940, #40010, #40030, #40048, #40050, #40052, #40071 - Failed merges:
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/slice.rs | 2 | ||||
| -rw-r--r-- | src/libcore/str/mod.rs | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 3e0b8425573..0331c5d4ba4 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -2202,6 +2202,7 @@ impl<A, B> PartialEq<[B]> for [A] where A: PartialEq<B> { #[stable(feature = "rust1", since = "1.0.0")] impl<T: Eq> Eq for [T] {} +/// Implements comparison of vectors lexicographically. #[stable(feature = "rust1", since = "1.0.0")] impl<T: Ord> Ord for [T] { fn cmp(&self, other: &[T]) -> Ordering { @@ -2209,6 +2210,7 @@ impl<T: Ord> Ord for [T] { } } +/// Implements comparison of vectors lexicographically. #[stable(feature = "rust1", since = "1.0.0")] impl<T: PartialOrd> PartialOrd for [T] { fn partial_cmp(&self, other: &[T]) -> Option<Ordering> { diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 49a6b1b5fce..925cd84154a 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1366,6 +1366,13 @@ mod traits { use ops; use str::eq_slice; + /// Implements ordering of strings. + /// + /// Strings are ordered lexicographically by their byte values. This orders Unicode code + /// points based on their positions in the code charts. This is not necessarily the same as + /// "alphabetical" order, which varies by language and locale. Sorting strings according to + /// culturally-accepted standards requires locale-specific data that is outside the scope of + /// the `str` type. #[stable(feature = "rust1", since = "1.0.0")] impl Ord for str { #[inline] @@ -1387,6 +1394,13 @@ mod traits { #[stable(feature = "rust1", since = "1.0.0")] impl Eq for str {} + /// Implements comparison operations on strings. + /// + /// Strings are compared lexicographically by their byte values. This compares Unicode code + /// points based on their positions in the code charts. This is not necessarily the same as + /// "alphabetical" order, which varies by language and locale. Comparing strings according to + /// culturally-accepted standards requires locale-specific data that is outside the scope of + /// the `str` type. #[stable(feature = "rust1", since = "1.0.0")] impl PartialOrd for str { #[inline] |
