Add is_empty method for ArrayVec and ArrayString

This commit is contained in:
nicbn
2019-11-14 18:58:22 -03:00
parent fc6664c540
commit 633c863b0a
2 changed files with 16 additions and 0 deletions
+4
View File
@@ -71,6 +71,10 @@ impl<A> ArrayString<A>
#[inline]
pub fn len(&self) -> usize { self.len.to_usize() }
/// Returns whether the string is empty.
#[inline]
pub fn is_empty(&self) -> bool { self.len() == 0 }
/// Create a new `ArrayString` from a `str`.
///
/// Capacity is inferred from the type parameter.