mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
add dict tests with string keys/values
This commit is contained in:
parent
7f8ca150f5
commit
02e161f839
3 changed files with 112 additions and 62 deletions
|
@ -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()) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue