Skip to content

Commit 42b46d2

Browse files
committed
Vec: looks like is_empty and len are not needed
1 parent 1b28ffa commit 42b46d2

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/libcollections/vec.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -812,32 +812,6 @@ impl<T> Vec<T> {
812812
self.truncate(0)
813813
}
814814

815-
/// Returns the number of elements in the vector.
816-
///
817-
/// # Examples
818-
///
819-
/// ```
820-
/// let a = vec![1, 2, 3];
821-
/// assert_eq!(a.len(), 3);
822-
/// ```
823-
#[inline]
824-
#[stable(feature = "rust1", since = "1.0.0")]
825-
pub fn len(&self) -> usize { self.len }
826-
827-
/// Returns `true` if the vector contains no elements.
828-
///
829-
/// # Examples
830-
///
831-
/// ```
832-
/// let mut v = Vec::new();
833-
/// assert!(v.is_empty());
834-
///
835-
/// v.push(1);
836-
/// assert!(!v.is_empty());
837-
/// ```
838-
#[stable(feature = "rust1", since = "1.0.0")]
839-
pub fn is_empty(&self) -> bool { self.len() == 0 }
840-
841815
/// Converts a `Vec<T>` to a `Vec<U>` where `T` and `U` have the same
842816
/// size and in case they are not zero-sized the same minimal alignment.
843817
///

0 commit comments

Comments
 (0)