Skip to content

Commit 0f841eb

Browse files
committed
fmt
1 parent e553e01 commit 0f841eb

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

library/alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ macro_rules! to_string_str {
566566
)+
567567
};
568568
}
569-
569+
570570
#[cfg(not(no_global_oom_handling))]
571571
to_string_str! {
572572
x x x x x x x x x x x x,

library/alloc/src/string/string.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,25 @@
88

99
use core::cmp::Ordering;
1010
use core::error::Error;
11-
use core::fmt;
12-
use core::hash;
11+
use core::iter::FusedIterator;
1312
#[cfg(not(no_global_oom_handling))]
1413
use core::iter::from_fn;
15-
use core::iter::FusedIterator;
1614
#[cfg(not(no_global_oom_handling))]
1715
use core::ops::Bound::{Excluded, Included, Unbounded};
1816
use core::ops::{self, Range, RangeBounds};
1917
#[cfg(not(no_global_oom_handling))]
2018
use core::ops::{Add, AddAssign};
21-
use core::ptr;
22-
use core::slice;
2319
use core::str::pattern::{Pattern, Utf8Pattern};
20+
use core::{fmt, hash, ptr, slice};
2421

2522
use crate::alloc::{Allocator, Global};
2623
#[cfg(not(no_global_oom_handling))]
2724
use crate::borrow::{Cow, ToOwned};
2825
use crate::boxed::Box;
2926
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};
3128
#[cfg(not(no_global_oom_handling))]
32-
use crate::str::{from_boxed_utf8_unchecked, FromStr};
29+
use crate::str::{FromStr, from_boxed_utf8_unchecked};
3330
use crate::string::ToString;
3431
use crate::vec::{self, Vec};
3532

@@ -521,7 +518,6 @@ impl<A: Allocator> String<A> {
521518

522519
Err(res)
523520
}
524-
525521
}
526522

527523
impl String {
@@ -634,7 +630,6 @@ impl String {
634630
}
635631
}
636632

637-
638633
/// Decode a UTF-16–encoded vector `v` into a `String`, returning [`Err`]
639634
/// if `v` contains any invalid data.
640635
///
@@ -1935,7 +1930,6 @@ impl<A: Allocator> String<A> {
19351930
IntoChars { bytes: self.into_bytes().into_iter() }
19361931
}
19371932

1938-
19391933
/// Removes the specified range in the string,
19401934
/// and replaces it with the given string.
19411935
/// The given string doesn't need to be the same length as the range.
@@ -2113,7 +2107,6 @@ impl<A: Allocator> FromUtf8Error<A> {
21132107
res
21142108
}
21152109

2116-
21172110
/// Returns the bytes that were attempted to convert to a `String`.
21182111
///
21192112
/// This method is carefully constructed to avoid allocation. It will
@@ -3056,7 +3049,6 @@ impl<A: Allocator> DoubleEndedIterator for IntoChars<A> {
30563049
#[unstable(feature = "string_into_chars", issue = "133125")]
30573050
impl<A: Allocator> FusedIterator for IntoChars<A> {}
30583051

3059-
30603052
/// A draining iterator for `String`.
30613053
///
30623054
/// This struct is created by the [`drain`] method on [`String`]. See its

0 commit comments

Comments
 (0)