diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-02-17 00:17:43 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-02-17 00:17:43 +0100 |
| commit | f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470 (patch) | |
| tree | 8cc7cbf2b3eebdc92b1e7c9d6ab9f34da3cd4169 /common/object/src/buffer.rs | |
| parent | b99fc498f2cf26c93d7888ea9aba4dd8cea60b2f (diff) | |
| download | jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar.bz2 jellything-f8b6afd57efc1a9e7e12fe1316bc45dcc6f32470.tar.zst | |
fix object align bugs
Diffstat (limited to 'common/object/src/buffer.rs')
| -rw-r--r-- | common/object/src/buffer.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/common/object/src/buffer.rs b/common/object/src/buffer.rs index 1792d73..05557e4 100644 --- a/common/object/src/buffer.rs +++ b/common/object/src/buffer.rs @@ -19,6 +19,9 @@ impl ObjectBuffer { pub fn as_object<'a>(&'a self) -> Object<'a> { Object::load(&self.0).unwrap() } + pub fn to_bytes(self) -> Vec<u8> { + self.0.into_iter().flat_map(u32::to_le_bytes).collect() + } pub fn new(fields: &mut [(Tag, &dyn ValueStore)]) -> ObjectBuffer { let mut tags = Vec::new(); let mut offsets = Vec::new(); |