FEAT: Add ArrayString::len
This method is no new feature, but it saves us from going through deref to str to fetch the length.
This commit is contained in:
@@ -67,6 +67,10 @@ impl<A> ArrayString<A>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return the length of the string.
|
||||||
|
#[inline]
|
||||||
|
pub fn len(&self) -> usize { self.len.to_usize() }
|
||||||
|
|
||||||
/// Create a new `ArrayString` from a `str`.
|
/// Create a new `ArrayString` from a `str`.
|
||||||
///
|
///
|
||||||
/// Capacity is inferred from the type parameter.
|
/// Capacity is inferred from the type parameter.
|
||||||
|
|||||||
Reference in New Issue
Block a user