]> git.bitcoin.ninja Git - rust-lightning/commitdiff
f Account for `KVStore::read` returning a `Vec<u8>`
authorElias Rohrer <dev@tnull.de>
Wed, 23 Aug 2023 10:36:16 +0000 (12:36 +0200)
committerElias Rohrer <dev@tnull.de>
Wed, 23 Aug 2023 13:17:10 +0000 (15:17 +0200)
lightning/src/util/test_utils.rs

index c692f2d03e515a9450bfe3d3f48a3b2d9a5b5e56..40096ac7bf4a36372f4f5927094ee41f8532554a 100644 (file)
@@ -341,14 +341,12 @@ impl TestStore {
 }
 
 impl KVStore for TestStore {
-       type Reader = io::Cursor<Vec<u8>>;
-
-       fn read(&self, namespace: &str, key: &str) -> io::Result<Self::Reader> {
+       fn read(&self, namespace: &str, key: &str) -> io::Result<Vec<u8>> {
                let persisted_lock = self.persisted_bytes.lock().unwrap();
                if let Some(outer_ref) = persisted_lock.get(namespace) {
                        if let Some(inner_ref) = outer_ref.get(key) {
                                let bytes = inner_ref.clone();
-                               Ok(io::Cursor::new(bytes))
+                               Ok(bytes)
                        } else {
                                Err(io::Error::new(io::ErrorKind::NotFound, "Key not found"))
                        }