From 395bd19d51c5f5e0bfd3b5897ddce5f6bef5ec79 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 25 Aug 2020 17:35:17 -0400 Subject: simplify API by moving `recover_func` to `load()` --- examples/demo1.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples') diff --git a/examples/demo1.rs b/examples/demo1.rs index d51801d..6f029ab 100644 --- a/examples/demo1.rs +++ b/examples/demo1.rs @@ -4,9 +4,9 @@ use growthring::{ }; use rand::{seq::SliceRandom, Rng}; -fn test Result<(), ()>>( +fn test( records: Vec, - wal: &mut WALWriter>, + wal: &mut WALWriter, ) -> Vec { let mut res = Vec::new(); for r in wal.grow(records).into_iter() { @@ -32,8 +32,8 @@ fn main() { let mut loader = WALLoader::new(); loader.file_nbit(9).block_nbit(8); - let store = WALStoreAIO::new(&wal_dir, true, recover, None).unwrap(); - let mut wal = loader.load(store).unwrap(); + let store = WALStoreAIO::new(&wal_dir, true, None).unwrap(); + let mut wal = loader.load(store, recover).unwrap(); for _ in 0..3 { test( ["hi", "hello", "lol"] @@ -50,8 +50,8 @@ fn main() { ); } - let store = WALStoreAIO::new(&wal_dir, false, recover, None).unwrap(); - let mut wal = loader.load(store).unwrap(); + let store = WALStoreAIO::new(&wal_dir, false, None).unwrap(); + let mut wal = loader.load(store, recover).unwrap(); for _ in 0..3 { test( vec![ @@ -64,8 +64,8 @@ fn main() { ); } - let store = WALStoreAIO::new(&wal_dir, false, recover, None).unwrap(); - let mut wal = loader.load(store).unwrap(); + let store = WALStoreAIO::new(&wal_dir, false, None).unwrap(); + let mut wal = loader.load(store, recover).unwrap(); for _ in 0..3 { let mut ids = Vec::new(); for _ in 0..3 { -- cgit v1.2.3-70-g09d2