From 7930d543a2aa68d4ad2958605827d7eb1baa91f8 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 27 Feb 2026 20:56:20 +0100 Subject: reimplement Object as slice type --- database/src/test_shared.rs | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'database/src/test_shared.rs') diff --git a/database/src/test_shared.rs b/database/src/test_shared.rs index 81d2e60..4d06a1f 100644 --- a/database/src/test_shared.rs +++ b/database/src/test_shared.rs @@ -4,25 +4,33 @@ Copyright (C) 2026 metamuffin */ -use jellyobject::{ObjectBuffer, fields}; +use jellyobject::{OBB, Object, fields}; fields! { - NAME: &str = b"name"; + NAME: str = b"name"; AGE: u32 = b"age1"; - FRIEND: &str = b"frnd"; + FRIEND: str = b"frnd"; } -pub(crate) fn new_bob() -> ObjectBuffer { - ObjectBuffer::new(&mut [ - (NAME.0, &"Bob"), - (AGE.0, &35_u32), - (FRIEND.0, &"Alice"), - (FRIEND.0, &"Charlie"), - ]) +pub(crate) fn new_bob() -> Box { + OBB::new() + .with(NAME, "Bob") + .with(AGE, 35) + .with(FRIEND, "Alice") + .with(FRIEND, "Charlie") + .finish() } -pub(crate) fn new_alice() -> ObjectBuffer { - ObjectBuffer::new(&mut [(NAME.0, &"Alice"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")]) +pub(crate) fn new_alice() -> Box { + OBB::new() + .with(NAME, "Alice") + .with(AGE, 31) + .with(FRIEND, "Bob") + .finish() } -pub(crate) fn new_charlie() -> ObjectBuffer { - ObjectBuffer::new(&mut [(NAME.0, &"Charlie"), (AGE.0, &31_u32), (FRIEND.0, &"Bob")]) +pub(crate) fn new_charlie() -> Box { + OBB::new() + .with(NAME, "Charlie") + .with(AGE, 31) + .with(FRIEND, "Bob") + .finish() } -- cgit v1.3