|
8 | 8 |
|
9 | 9 | use core::cmp::Ordering;
|
10 | 10 | use core::error::Error;
|
11 |
| -use core::fmt; |
12 |
| -use core::hash; |
| 11 | +use core::iter::FusedIterator; |
13 | 12 | #[cfg(not(no_global_oom_handling))]
|
14 | 13 | use core::iter::from_fn;
|
15 |
| -use core::iter::FusedIterator; |
16 | 14 | #[cfg(not(no_global_oom_handling))]
|
17 | 15 | use core::ops::Bound::{Excluded, Included, Unbounded};
|
18 | 16 | use core::ops::{self, Range, RangeBounds};
|
19 | 17 | #[cfg(not(no_global_oom_handling))]
|
20 | 18 | use core::ops::{Add, AddAssign};
|
21 |
| -use core::ptr; |
22 |
| -use core::slice; |
23 | 19 | use core::str::pattern::{Pattern, Utf8Pattern};
|
| 20 | +use core::{fmt, hash, ptr, slice}; |
24 | 21 |
|
25 | 22 | use crate::alloc::{Allocator, Global};
|
26 | 23 | #[cfg(not(no_global_oom_handling))]
|
27 | 24 | use crate::borrow::{Cow, ToOwned};
|
28 | 25 | use crate::boxed::Box;
|
29 | 26 | use crate::collections::TryReserveError;
|
30 |
| -use crate::str::{self, from_utf8_unchecked_mut, CharIndices, Chars, Utf8Error}; |
| 27 | +use crate::str::{self, CharIndices, Chars, Utf8Error, from_utf8_unchecked_mut}; |
31 | 28 | #[cfg(not(no_global_oom_handling))]
|
32 |
| -use crate::str::{from_boxed_utf8_unchecked, FromStr}; |
| 29 | +use crate::str::{FromStr, from_boxed_utf8_unchecked}; |
33 | 30 | use crate::string::ToString;
|
34 | 31 | use crate::vec::{self, Vec};
|
35 | 32 |
|
@@ -521,7 +518,6 @@ impl<A: Allocator> String<A> {
|
521 | 518 |
|
522 | 519 | Err(res)
|
523 | 520 | }
|
524 |
| - |
525 | 521 | }
|
526 | 522 |
|
527 | 523 | impl String {
|
@@ -634,7 +630,6 @@ impl String {
|
634 | 630 | }
|
635 | 631 | }
|
636 | 632 |
|
637 |
| - |
638 | 633 | /// Decode a UTF-16–encoded vector `v` into a `String`, returning [`Err`]
|
639 | 634 | /// if `v` contains any invalid data.
|
640 | 635 | ///
|
@@ -1935,7 +1930,6 @@ impl<A: Allocator> String<A> {
|
1935 | 1930 | IntoChars { bytes: self.into_bytes().into_iter() }
|
1936 | 1931 | }
|
1937 | 1932 |
|
1938 |
| - |
1939 | 1933 | /// Removes the specified range in the string,
|
1940 | 1934 | /// and replaces it with the given string.
|
1941 | 1935 | /// The given string doesn't need to be the same length as the range.
|
@@ -2113,7 +2107,6 @@ impl<A: Allocator> FromUtf8Error<A> {
|
2113 | 2107 | res
|
2114 | 2108 | }
|
2115 | 2109 |
|
2116 |
| - |
2117 | 2110 | /// Returns the bytes that were attempted to convert to a `String`.
|
2118 | 2111 | ///
|
2119 | 2112 | /// This method is carefully constructed to avoid allocation. It will
|
@@ -3056,7 +3049,6 @@ impl<A: Allocator> DoubleEndedIterator for IntoChars<A> {
|
3056 | 3049 | #[unstable(feature = "string_into_chars", issue = "133125")]
|
3057 | 3050 | impl<A: Allocator> FusedIterator for IntoChars<A> {}
|
3058 | 3051 |
|
3059 |
| - |
3060 | 3052 | /// A draining iterator for `String`.
|
3061 | 3053 | ///
|
3062 | 3054 | /// This struct is created by the [`drain`] method on [`String`]. See its
|
|
0 commit comments