mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-04 00:54:36 +00:00
add RocRefcounted to SendSafe types
This commit is contained in:
parent
f8b0be725c
commit
0e162a767d
2 changed files with 31 additions and 0 deletions
|
@ -764,6 +764,20 @@ pub struct SendSafeRocStr(RocStr);
|
|||
|
||||
unsafe impl Send for SendSafeRocStr {}
|
||||
|
||||
impl RocRefcounted for SendSafeRocStr {
|
||||
fn inc(&mut self) {
|
||||
self.0.inc()
|
||||
}
|
||||
|
||||
fn dec(&mut self) {
|
||||
self.0.dec()
|
||||
}
|
||||
|
||||
fn is_refcounted() -> bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for SendSafeRocStr {
|
||||
fn clone(&self) -> Self {
|
||||
if self.0.is_readonly() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue