mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
Implement From<&str> for RocStr
Makes it easier to use in Tests...
This commit is contained in:
parent
4502471e9a
commit
aa56e4d0e2
1 changed files with 6 additions and 0 deletions
|
@ -382,6 +382,12 @@ impl RocStr {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<&str> for RocStr {
|
||||
fn from(str: &str) -> Self {
|
||||
Self::from_slice(str.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for RocStr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
// RocStr { is_small_str: false, storage: Refcounted(3), elements: [ 1,2,3,4] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue