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:
bluss
2019-10-09 10:32:14 +02:00
parent 05667bb860
commit f665142854
+4
View File
@@ -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`.
///
/// Capacity is inferred from the type parameter.