Skip to content

Commit 1798097

Browse files
committed
f Account for KVStore::read returning a Vec<u8>
1 parent 42ab1f2 commit 1798097

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lightning/src/util/test_utils.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,12 @@ impl TestStore {
341341
}
342342

343343
impl KVStore for TestStore {
344-
type Reader = io::Cursor<Vec<u8>>;
345-
346-
fn read(&self, namespace: &str, key: &str) -> io::Result<Self::Reader> {
344+
fn read(&self, namespace: &str, key: &str) -> io::Result<Vec<u8>> {
347345
let persisted_lock = self.persisted_bytes.lock().unwrap();
348346
if let Some(outer_ref) = persisted_lock.get(namespace) {
349347
if let Some(inner_ref) = outer_ref.get(key) {
350348
let bytes = inner_ref.clone();
351-
Ok(io::Cursor::new(bytes))
349+
Ok(bytes)
352350
} else {
353351
Err(io::Error::new(io::ErrorKind::NotFound, "Key not found"))
354352
}

0 commit comments

Comments
 (0)