Skip to content

Commit

Permalink
Bump shrink_to stabilization to Rust 1.56
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 8, 2021
1 parent 4867a21 commit 8ec5060
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library/alloc/src/collections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ impl<T> BinaryHeap<T> {
/// assert!(heap.capacity() >= 10);
/// ```
#[inline]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.data.shrink_to(min_capacity)
}
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/collections/vec_deque/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ impl<T> VecDeque<T> {
/// buf.shrink_to(0);
/// assert!(buf.capacity() >= 4);
/// ```
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
let min_capacity = cmp::min(min_capacity, self.capacity());
// We don't have to worry about an overflow as neither `self.len()` nor `self.capacity()`
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ impl String {
/// ```
#[cfg(not(no_global_oom_handling))]
#[inline]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.vec.shrink_to(min_capacity)
}
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/vec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// assert!(vec.capacity() >= 3);
/// ```
#[cfg(not(no_global_oom_handling))]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
if self.capacity() > min_capacity {
self.buf.shrink_to_fit(cmp::max(self.len, min_capacity));
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ where
/// assert!(map.capacity() >= 2);
/// ```
#[inline]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.base.shrink_to(min_capacity);
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ where
/// assert!(set.capacity() >= 2);
/// ```
#[inline]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.base.shrink_to(min_capacity)
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/ffi/os_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl OsString {
/// assert!(s.capacity() >= 3);
/// ```
#[inline]
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.inner.shrink_to(min_capacity)
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ impl PathBuf {
/// Invokes [`shrink_to`] on the underlying instance of [`OsString`].
///
/// [`shrink_to`]: OsString::shrink_to
#[stable(feature = "shrink_to", since = "1.55.0")]
#[stable(feature = "shrink_to", since = "1.56.0")]
#[inline]
pub fn shrink_to(&mut self, min_capacity: usize) {
self.inner.shrink_to(min_capacity)
Expand Down

0 comments on commit 8ec5060

Please sign in to comment.