Skip to content

Commit

Permalink
rename crates to storey
Browse files Browse the repository at this point in the history
  • Loading branch information
uint committed Mar 20, 2024
1 parent 568a940 commit 91aafc8
Show file tree
Hide file tree
Showing 18 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ license = "Apache-2.0"
[workspace.dependencies]
thiserror = "1"

stork = { path = "crates/stork", version = "0.1.0" }
storey = { path = "crates/storey", version = "0.1.0" }
4 changes: 2 additions & 2 deletions crates/cw-stork/Cargo.toml → crates/cw-storey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "cw-stork"
name = "cw-storey"
authors = { workspace = true }
version = "0.1.0"
edition = "2021"
license = { workspace = true }

[dependencies]
stork = { workspace = true }
storey = { workspace = true }
File renamed without changes.
2 changes: 1 addition & 1 deletion crates/stork/Cargo.toml → crates/storey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "stork"
name = "storey"
authors = { workspace = true }
version = "0.1.0"
edition = "2021"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! ## Encoding example
//!
//! ```
//! use stork::encoding::{EncodableWithImpl, Encoding, Cover};
//! use storey::encoding::{EncodableWithImpl, Encoding, Cover};
//!
//! // - Implementation -
//!
Expand All @@ -49,7 +49,7 @@
//!
//! // - Usage -
//!
//! use stork::encoding::EncodableWith as _;
//! use storey::encoding::EncodableWith as _;
//!
//! // If there's only one encoding present for `u64`, we can use `encode` directly.
//! // Otherwise, we would need to disambiguate.
Expand All @@ -60,7 +60,7 @@
//! ## Decoding example
//!
//! ```
//! use stork::encoding::{DecodableWithImpl, Encoding, Cover};
//! use storey::encoding::{DecodableWithImpl, Encoding, Cover};
//!
//! // - Implementation -
//!
Expand All @@ -84,7 +84,7 @@
//!
//! // - Usage -
//!
//! use stork::encoding::DecodableWith as _;
//! use storey::encoding::DecodableWith as _;
//!
//! // If there's only one encoding present for `u64`, we can use `decode` directly.
//! // Otherwise, we would need to disambiguate.
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod common;
fn storage_backend() {
// TODO: split this into multiple tests?

use stork::{IterableStorage as _, RevIterableStorage as _, StorageMut as _};
use storey::{IterableStorage as _, RevIterableStorage as _, StorageMut as _};

let mut storage = common::backend::TestStorage::new();

Expand Down Expand Up @@ -103,14 +103,14 @@ fn storage_backend() {

#[test]
fn metadata() {
use stork::StorageMut as _;
use storey::StorageMut as _;

let mut storage = common::backend::TestStorage::new();
storage.set_meta(&[0], b"meta");

assert_eq!(stork::StorageBackend::get(&storage, &[0]), None);
assert_eq!(storey::StorageBackend::get(&storage, &[0]), None);
assert_eq!(
stork::StorageBackend::get(&storage, &[255, 0]),
storey::StorageBackend::get(&storage, &[255, 0]),
Some(b"meta".to_vec())
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{cell::UnsafeCell, collections::BTreeMap};

use stork::IterableStorage as _;
use storey::IterableStorage as _;

// `UnsafeCell` is needed here to implement interior mutability.
// https://doc.rust-lang.org/book/ch15-05-interior-mutability.html
Expand All @@ -25,14 +25,14 @@ impl TestStorage {
// Moreover, we can further guarantee that the dereference is valid because the data
// is always initialized during construction.

impl stork::StorageBackend for TestStorage {
impl storey::StorageBackend for TestStorage {
fn get(&self, key: &[u8]) -> Option<Vec<u8>> {
// Safety: see above
unsafe { (*self.0.get()).get(key).cloned() }
}
}

impl stork::StorageBackendMut for TestStorage {
impl storey::StorageBackendMut for TestStorage {
fn set(&mut self, key: &[u8], value: &[u8]) {
// Safety: see above
unsafe {
Expand All @@ -48,7 +48,7 @@ impl stork::StorageBackendMut for TestStorage {
}
}

impl stork::IterableStorage for TestStorage {
impl storey::IterableStorage for TestStorage {
type KeysIterator<'a> = Box<dyn DoubleEndedIterator<Item = Vec<u8>> + 'a>;
type ValuesIterator<'a> = Box<dyn DoubleEndedIterator<Item = Vec<u8>> + 'a>;
type PairsIterator<'a> = Box<dyn DoubleEndedIterator<Item = (Vec<u8>, Vec<u8>)> + 'a>;
Expand Down Expand Up @@ -92,7 +92,7 @@ impl stork::IterableStorage for TestStorage {
}
}

impl stork::RevIterableStorage for TestStorage {
impl storey::RevIterableStorage for TestStorage {
type RevKeysIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a>;
type RevValuesIterator<'a> = Box<dyn Iterator<Item = Vec<u8>> + 'a>;
type RevPairsIterator<'a> = Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + 'a>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use stork::encoding::{Cover, DecodableWithImpl, EncodableWithImpl, Encoding};
use storey::encoding::{Cover, DecodableWithImpl, EncodableWithImpl, Encoding};

// An implementation of an encoding used for tests.
//
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
mod common;

use stork::containers::{Column, Item, Map};
use stork::Storage as _;
use storey::containers::{Column, Item, Map};
use storey::Storage as _;

use common::backend::TestStorage;
use common::encoding::TestEncoding;
Expand Down Expand Up @@ -161,7 +161,7 @@ fn column() {
access.remove(0).unwrap();
assert_eq!(
access.update(0, &9001),
Err(stork::containers::column::UpdateError::NotFound)
Err(storey::containers::column::UpdateError::NotFound)
);
access.update(1, &9001).unwrap();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod common;

use stork::encoding::{DecodableWith as _, EncodableWith as _};
use storey::encoding::{DecodableWith as _, EncodableWith as _};

#[test]
fn encoding() {
Expand Down

0 comments on commit 91aafc8

Please sign in to comment.