Skip to content

Commit

Permalink
Add 'is_empty()' method.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Apr 7, 2021
1 parent d4baacb commit b7b21da
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/borrowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ impl UncasedStr {
self.as_str().len()
}

/// Returns `true` if `self` has a length of zero bytes.
///
/// # Examples
///
/// ```
/// use uncased::UncasedStr;
///
/// let s = UncasedStr::new("");
/// assert!(s.is_empty());
///
/// let s = UncasedStr::new("not empty");
/// assert!(!s.is_empty());
/// ```
#[inline]
pub fn is_empty(&self) -> bool {
self.as_str().is_empty()
}

/// Returns `true` if `self` starts with any casing of the string `string`;
/// otherwise, returns `false`.
///
Expand Down

0 comments on commit b7b21da

Please sign in to comment.