mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-20 15:27:45 +03:00
feat: implement shallow clone for PExpected
This commit is contained in:
parent
05181e4be0
commit
22dc0fe6c7
@ -12,6 +12,7 @@
|
||||
/// This is important for performance.
|
||||
use libc::{c_void, MAP_ANONYMOUS, MAP_PRIVATE, PROT_READ, PROT_WRITE};
|
||||
use roc_can::expected::Expected;
|
||||
use roc_can::expected::PExpected;
|
||||
use std::cmp::Ordering;
|
||||
use std::marker::PhantomData;
|
||||
use std::mem::size_of;
|
||||
@ -620,3 +621,14 @@ impl<T: ShallowClone> ShallowClone for Expected<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: ShallowClone> ShallowClone for PExpected<T> {
|
||||
fn shallow_clone(&self) -> Self {
|
||||
use PExpected::*;
|
||||
|
||||
match self {
|
||||
NoExpectation(t) => NoExpectation(t.shallow_clone()),
|
||||
ForReason(reason, t, region) => ForReason(reason.clone(), t.shallow_clone(), *region),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user