aboutsummaryrefslogtreecommitdiff
path: root/database/src/test_shared.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-02-27 20:56:20 +0100
committermetamuffin <metamuffin@disroot.org>2026-02-27 20:56:20 +0100
commit7930d543a2aa68d4ad2958605827d7eb1baa91f8 (patch)
treefe59d1f549e303a96b78d3e925d75abb70b73af0 /database/src/test_shared.rs
parentc05bfcc2775f0e11db6e856bfcf06d0419c35d54 (diff)
downloadjellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar
jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.bz2
jellything-7930d543a2aa68d4ad2958605827d7eb1baa91f8.tar.zst
reimplement Object as slice type
Diffstat (limited to 'database/src/test_shared.rs')
-rw-r--r--database/src/test_shared.rs36
1 files changed, 22 insertions, 14 deletions
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 <metamuffin.org>
*/
-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<Object> {
+ 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<Object> {
+ 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<Object> {
+ OBB::new()
+ .with(NAME, "Charlie")
+ .with(AGE, 31)
+ .with(FRIEND, "Bob")
+ .finish()
}