checkpoint

This commit is contained in:
Folkert 2023-09-13 17:23:13 +02:00
parent 3c8dbce72e
commit 5e4f43e1d8
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
12 changed files with 296 additions and 109 deletions

View file

@ -1,5 +1,5 @@
//! Provides Rust representations of Roc data structures.
#![cfg_attr(not(feature = "std"), no_std)]
// #![cfg_attr(not(feature = "std"), no_std)]
#![crate_type = "lib"]
use arrayvec::ArrayString;
@ -227,10 +227,19 @@ impl<T, E> Drop for RocResult<T, E> {
}
}
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[repr(C)]
pub struct RocDec([u8; 16]);
impl Debug for RocDec {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("RocDec")
.field(&self.0)
.field(&self.to_str())
.finish()
}
}
impl RocDec {
pub const MIN: Self = Self(i128::MIN.to_ne_bytes());
pub const MAX: Self = Self(i128::MAX.to_ne_bytes());