mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-01 10:52:18 +00:00
RocCallResult::new
This commit is contained in:
parent
b2b0653592
commit
ddead4dfcc
1 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,16 @@ pub struct RocCallResult<T> {
|
|||
value: MaybeUninit<T>,
|
||||
}
|
||||
|
||||
impl<T> RocCallResult<T> {
|
||||
pub fn new(value: T) -> Self {
|
||||
Self {
|
||||
tag: 0,
|
||||
error_msg: std::ptr::null_mut(),
|
||||
value: MaybeUninit::new(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Default> Default for RocCallResult<T> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue