add dict tests with string keys/values

This commit is contained in:
Folkert 2021-02-14 15:49:40 +01:00
parent 7f8ca150f5
commit 02e161f839
3 changed files with 112 additions and 62 deletions

View file

@ -401,6 +401,10 @@ impl RocStr {
Self::from_slice_with_capacity_str(slice, slice.len())
}
pub fn from_str(slice: &str) -> RocStr {
Self::from_slice_with_capacity_str(slice.as_bytes(), slice.len())
}
pub fn as_slice(&self) -> &[u8] {
if self.is_small_str() {
unsafe { core::slice::from_raw_parts(self.get_small_str_ptr(), self.len()) }