mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Bump shrink_to stabilization to Rust 1.56
This commit is contained in:
@@ -973,7 +973,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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)
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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()`
|
||||
|
||||
@@ -1110,7 +1110,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// ```
|
||||
#[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)
|
||||
}
|
||||
|
||||
@@ -951,7 +951,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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));
|
||||
|
||||
@@ -677,7 +677,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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);
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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)
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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)
|
||||
}
|
||||
|
||||
@@ -1398,7 +1398,7 @@ pub fn shrink_to_fit(&mut self) {
|
||||
/// 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)
|
||||
|
||||
Reference in New Issue
Block a user