Skip to content

Commit

Permalink
Fix deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsch committed May 17, 2023
1 parent 01efae0 commit 122e37f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test-fixtures/src/bin/kv_store.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
//! A guest program to test that object store works properly.
//! A guest program to test that KV store works properly.
use fastly::ObjectStore;
use fastly::object_store::ObjectStoreError::ObjectStoreNotFound;
use fastly::kv_store::{KVStore, KVStoreError::KVStoreNotFound};

fn main() {
// Check we can't get a store that does not exist
match ObjectStore::open("non_existant") {
Err(ObjectStoreNotFound(_)) => {},
match KVStore::open("non_existant") {
Err(KVStoreNotFound(_)) => {}
_ => panic!(),
}

let store_one = ObjectStore::open("store_one").unwrap().unwrap();
let store_one = KVStore::open("store_one").unwrap().unwrap();
// Test that we can get data using the `data` config key
assert_eq!(
store_one.lookup_str("first").unwrap().unwrap(),
Expand All @@ -22,7 +21,7 @@ fn main() {
"More data"
);

let mut empty_store = ObjectStore::open("empty_store").unwrap().unwrap();
let mut empty_store = KVStore::open("empty_store").unwrap().unwrap();
// Check that the value "bar" is not in the store
assert_eq!(empty_store.lookup_str("bar"), Ok(None));
empty_store.insert("bar", "foo").unwrap();
Expand Down

0 comments on commit 122e37f

Please sign in to comment.