diff --git a/cli/src/argparse/mod.rs b/cli/src/argparse/mod.rs index ab54326f1..3bdac1a8f 100644 --- a/cli/src/argparse/mod.rs +++ b/cli/src/argparse/mod.rs @@ -1,3 +1,8 @@ +// Nested functions that always return Ok(..) are used as callbacks in a context where a Result is +// expected, so the unnecessary_wraps clippy lint is not useful here. + +#![allow(clippy::unnecessary_wraps)] + /*! This module is responsible for parsing command lines (`Arglist`, an alias for `&[&str]`) into `Command` instances. diff --git a/cli/src/invocation/mod.rs b/cli/src/invocation/mod.rs index fd910a8f0..feff61c27 100644 --- a/cli/src/invocation/mod.rs +++ b/cli/src/invocation/mod.rs @@ -23,7 +23,7 @@ pub(crate) fn invoke(command: Command, settings: Config) -> anyhow::Result<()> { log::debug!("command: {:?}", command); log::debug!("settings: {:?}", settings); - let mut w = get_writer()?; + let mut w = get_writer(); // This function examines the command and breaks out the necessary bits to call one of the // `execute` functions in a submodule of `cmd`. @@ -132,14 +132,14 @@ fn get_server(settings: &Config) -> anyhow::Result> { log::debug!("Using local sync-server at `{:?}`", server_dir); ServerConfig::Local { server_dir } }; - Ok(config.into_server()?) + config.into_server() } /// Get a WriteColor implementation based on whether the output is a tty. -fn get_writer() -> anyhow::Result { - Ok(StandardStream::stdout(if atty::is(atty::Stream::Stdout) { +fn get_writer() -> StandardStream { + StandardStream::stdout(if atty::is(atty::Stream::Stdout) { ColorChoice::Auto } else { ColorChoice::Never - })) + }) } diff --git a/sync-server/src/main.rs b/sync-server/src/main.rs index 296a18aa2..2ae65ae5c 100644 --- a/sync-server/src/main.rs +++ b/sync-server/src/main.rs @@ -1,6 +1,6 @@ #![deny(clippy::all)] -use crate::storage::{KVStorage, Storage}; +use crate::storage::{KvStorage, Storage}; use actix_web::{get, middleware::Logger, web, App, HttpServer, Responder, Scope}; use api::{api_scope, ServerState}; use clap::Arg; @@ -56,7 +56,7 @@ async fn main() -> anyhow::Result<()> { let data_dir = matches.value_of("data-dir").unwrap(); let port = matches.value_of("port").unwrap(); - let server_box: Box = Box::new(KVStorage::new(data_dir)?); + let server_box: Box = Box::new(KvStorage::new(data_dir)?); let server_state = ServerState::new(server_box); log::warn!("Serving on port {}", port); diff --git a/sync-server/src/storage/kv.rs b/sync-server/src/storage/kv.rs index 41f441844..89a4d3380 100644 --- a/sync-server/src/storage/kv.rs +++ b/sync-server/src/storage/kv.rs @@ -20,15 +20,15 @@ fn client_db_key(client_key: Uuid) -> ClientDbKey { *client_key.as_bytes() } -/// KVStorage is an on-disk storage backend which uses LMDB via the `kv` crate. -pub(crate) struct KVStorage<'t> { +/// KvStorage is an on-disk storage backend which uses LMDB via the `kv` crate. +pub(crate) struct KvStorage<'t> { store: Store, clients_bucket: Bucket<'t, ClientDbKey, ValueBuf>>, versions_bucket: Bucket<'t, VersionDbKey, ValueBuf>>, } -impl<'t> KVStorage<'t> { - pub fn new>(directory: P) -> anyhow::Result> { +impl<'t> KvStorage<'t> { + pub fn new>(directory: P) -> anyhow::Result> { let mut config = Config::default(directory); config.bucket("clients", None); config.bucket("versions", None); @@ -40,7 +40,7 @@ impl<'t> KVStorage<'t> { let versions_bucket = store.bucket::>>(Some("versions"))?; - Ok(KVStorage { + Ok(KvStorage { store, clients_bucket, versions_bucket, @@ -48,7 +48,7 @@ impl<'t> KVStorage<'t> { } } -impl<'t> Storage for KVStorage<'t> { +impl<'t> Storage for KvStorage<'t> { fn txn<'a>(&'a self) -> anyhow::Result> { Ok(Box::new(Txn { storage: self, @@ -58,7 +58,7 @@ impl<'t> Storage for KVStorage<'t> { } struct Txn<'t> { - storage: &'t KVStorage<'t>, + storage: &'t KvStorage<'t>, txn: Option>, } @@ -169,7 +169,7 @@ mod test { #[test] fn test_get_client_empty() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let storage = KVStorage::new(&tmp_dir.path())?; + let storage = KvStorage::new(&tmp_dir.path())?; let mut txn = storage.txn()?; let maybe_client = txn.get_client(Uuid::new_v4())?; assert!(maybe_client.is_none()); @@ -179,7 +179,7 @@ mod test { #[test] fn test_client_storage() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let storage = KVStorage::new(&tmp_dir.path())?; + let storage = KvStorage::new(&tmp_dir.path())?; let mut txn = storage.txn()?; let client_key = Uuid::new_v4(); @@ -201,7 +201,7 @@ mod test { #[test] fn test_gvbp_empty() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let storage = KVStorage::new(&tmp_dir.path())?; + let storage = KvStorage::new(&tmp_dir.path())?; let mut txn = storage.txn()?; let maybe_version = txn.get_version_by_parent(Uuid::new_v4(), Uuid::new_v4())?; assert!(maybe_version.is_none()); @@ -211,7 +211,7 @@ mod test { #[test] fn test_add_version_and_gvbp() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let storage = KVStorage::new(&tmp_dir.path())?; + let storage = KvStorage::new(&tmp_dir.path())?; let mut txn = storage.txn()?; let client_key = Uuid::new_v4(); diff --git a/sync-server/src/storage/mod.rs b/sync-server/src/storage/mod.rs index e0e13ae93..1d1cbe139 100644 --- a/sync-server/src/storage/mod.rs +++ b/sync-server/src/storage/mod.rs @@ -7,7 +7,7 @@ mod inmemory; pub(crate) use inmemory::InMemoryStorage; mod kv; -pub(crate) use self::kv::KVStorage; +pub(crate) use self::kv::KvStorage; #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)] pub(crate) struct Client { diff --git a/taskchampion/src/errors.rs b/taskchampion/src/errors.rs index 801eb5926..9e2a712a5 100644 --- a/taskchampion/src/errors.rs +++ b/taskchampion/src/errors.rs @@ -2,5 +2,5 @@ use thiserror::Error; #[derive(Debug, Error, Eq, PartialEq, Clone)] pub enum Error { #[error("Task Database Error: {}", _0)] - DBError(String), + DbError(String), } diff --git a/taskchampion/src/replica.rs b/taskchampion/src/replica.rs index f223e55aa..ac1baea88 100644 --- a/taskchampion/src/replica.rs +++ b/taskchampion/src/replica.rs @@ -2,7 +2,7 @@ use crate::errors::Error; use crate::server::Server; use crate::storage::{Operation, Storage, TaskMap}; use crate::task::{Status, Task}; -use crate::taskdb::TaskDB; +use crate::taskdb::TaskDb; use crate::workingset::WorkingSet; use chrono::Utc; use log::trace; @@ -24,13 +24,13 @@ use uuid::Uuid; /// pending tasks are automatically added to the working set, and the working set is "renumbered" /// during the garbage-collection process. pub struct Replica { - taskdb: TaskDB, + taskdb: TaskDb, } impl Replica { pub fn new(storage: Box) -> Replica { Replica { - taskdb: TaskDB::new(storage), + taskdb: TaskDb::new(storage), } } @@ -112,7 +112,7 @@ impl Replica { // check that it already exists; this is a convenience check, as the task may already exist // when this Create operation is finally sync'd with operations from other replicas if self.taskdb.get_task(uuid)?.is_none() { - return Err(Error::DBError(format!("Task {} does not exist", uuid)).into()); + return Err(Error::DbError(format!("Task {} does not exist", uuid)).into()); } self.taskdb.apply(Operation::Delete { uuid })?; trace!("task {} deleted", uuid); diff --git a/taskchampion/src/storage/config.rs b/taskchampion/src/storage/config.rs index c87ae007d..773baa035 100644 --- a/taskchampion/src/storage/config.rs +++ b/taskchampion/src/storage/config.rs @@ -1,4 +1,4 @@ -use super::{InMemoryStorage, KVStorage, Storage}; +use super::{InMemoryStorage, KvStorage, Storage}; use std::path::PathBuf; /// The configuration required for a replica's storage. @@ -15,7 +15,7 @@ pub enum StorageConfig { impl StorageConfig { pub fn into_storage(self) -> anyhow::Result> { Ok(match self { - StorageConfig::OnDisk { taskdb_dir } => Box::new(KVStorage::new(taskdb_dir)?), + StorageConfig::OnDisk { taskdb_dir } => Box::new(KvStorage::new(taskdb_dir)?), StorageConfig::InMemory => Box::new(InMemoryStorage::new()), }) } diff --git a/taskchampion/src/storage/kv.rs b/taskchampion/src/storage/kv.rs index a08b6b284..c33e78e72 100644 --- a/taskchampion/src/storage/kv.rs +++ b/taskchampion/src/storage/kv.rs @@ -5,8 +5,8 @@ use kv::{Bucket, Config, Error, Integer, Serde, Store, ValueBuf}; use std::path::Path; use uuid::Uuid; -/// KVStorage is an on-disk storage backend which uses LMDB via the `kv` crate. -pub struct KVStorage<'t> { +/// KvStorage is an on-disk storage backend which uses LMDB via the `kv` crate. +pub struct KvStorage<'t> { store: Store, tasks_bucket: Bucket<'t, Key, ValueBuf>>, numbers_bucket: Bucket<'t, Integer, ValueBuf>>, @@ -19,8 +19,8 @@ const BASE_VERSION: u64 = 1; const NEXT_OPERATION: u64 = 2; const NEXT_WORKING_SET_INDEX: u64 = 3; -impl<'t> KVStorage<'t> { - pub fn new>(directory: P) -> anyhow::Result> { +impl<'t> KvStorage<'t> { + pub fn new>(directory: P) -> anyhow::Result> { let mut config = Config::default(directory); config.bucket("tasks", None); config.bucket("numbers", None); @@ -48,7 +48,7 @@ impl<'t> KVStorage<'t> { let working_set_bucket = store.int_bucket::>>(Some("working_set"))?; - Ok(KVStorage { + Ok(KvStorage { store, tasks_bucket, numbers_bucket, @@ -59,7 +59,7 @@ impl<'t> KVStorage<'t> { } } -impl<'t> Storage for KVStorage<'t> { +impl<'t> Storage for KvStorage<'t> { fn txn<'a>(&'a mut self) -> anyhow::Result> { Ok(Box::new(Txn { storage: self, @@ -69,7 +69,7 @@ impl<'t> Storage for KVStorage<'t> { } struct Txn<'t> { - storage: &'t KVStorage<'t>, + storage: &'t KvStorage<'t>, txn: Option>, } @@ -359,7 +359,7 @@ mod test { #[test] fn test_create() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -377,7 +377,7 @@ mod test { #[test] fn test_create_exists() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -395,7 +395,7 @@ mod test { #[test] fn test_get_missing() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -408,7 +408,7 @@ mod test { #[test] fn test_set_task() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -429,7 +429,7 @@ mod test { #[test] fn test_delete_task_missing() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -441,7 +441,7 @@ mod test { #[test] fn test_delete_task_exists() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -458,7 +458,7 @@ mod test { #[test] fn test_all_tasks_empty() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; { let mut txn = storage.txn()?; let tasks = txn.all_tasks()?; @@ -470,7 +470,7 @@ mod test { #[test] fn test_all_tasks_and_uuids() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid1 = Uuid::new_v4(); let uuid2 = Uuid::new_v4(); { @@ -524,7 +524,7 @@ mod test { #[test] fn test_base_version_default() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; { let mut txn = storage.txn()?; assert_eq!(txn.base_version()?, DEFAULT_BASE_VERSION); @@ -535,7 +535,7 @@ mod test { #[test] fn test_base_version_setting() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let u = Uuid::new_v4(); { let mut txn = storage.txn()?; @@ -552,7 +552,7 @@ mod test { #[test] fn test_operations() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid1 = Uuid::new_v4(); let uuid2 = Uuid::new_v4(); let uuid3 = Uuid::new_v4(); @@ -616,7 +616,7 @@ mod test { #[test] fn get_working_set_empty() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; { let mut txn = storage.txn()?; @@ -630,7 +630,7 @@ mod test { #[test] fn add_to_working_set() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid1 = Uuid::new_v4(); let uuid2 = Uuid::new_v4(); @@ -653,7 +653,7 @@ mod test { #[test] fn clear_working_set() -> anyhow::Result<()> { let tmp_dir = TempDir::new("test")?; - let mut storage = KVStorage::new(&tmp_dir.path())?; + let mut storage = KvStorage::new(&tmp_dir.path())?; let uuid1 = Uuid::new_v4(); let uuid2 = Uuid::new_v4(); diff --git a/taskchampion/src/storage/mod.rs b/taskchampion/src/storage/mod.rs index c5ffb8cc2..b263fd56f 100644 --- a/taskchampion/src/storage/mod.rs +++ b/taskchampion/src/storage/mod.rs @@ -14,7 +14,7 @@ mod inmemory; mod kv; mod operation; -pub use self::kv::KVStorage; +pub use self::kv::KvStorage; pub use config::StorageConfig; pub use inmemory::InMemoryStorage; @@ -83,7 +83,7 @@ pub trait StorageTxn { fn operations(&mut self) -> Result>; /// Add an operation to the end of the list of operations in the storage. Note that this - /// merely *stores* the operation; it is up to the TaskDB to apply it. + /// merely *stores* the operation; it is up to the TaskDb to apply it. fn add_operation(&mut self, op: Operation) -> Result<()>; /// Replace the current list of operations with a new list. diff --git a/taskchampion/src/storage/operation.rs b/taskchampion/src/storage/operation.rs index fd88e17f9..ef52f2cb4 100644 --- a/taskchampion/src/storage/operation.rs +++ b/taskchampion/src/storage/operation.rs @@ -126,7 +126,7 @@ impl Operation { mod test { use super::*; use crate::storage::InMemoryStorage; - use crate::taskdb::TaskDB; + use crate::taskdb::TaskDb; use chrono::{Duration, Utc}; use proptest::prelude::*; @@ -145,7 +145,7 @@ mod test { // check that the two operation sequences have the same effect, enforcing the invariant of // the transform function. - let mut db1 = TaskDB::new_inmemory(); + let mut db1 = TaskDb::new_inmemory(); if let Some(ref o) = setup { db1.apply(o.clone()).unwrap(); } @@ -154,7 +154,7 @@ mod test { db1.apply(o).unwrap(); } - let mut db2 = TaskDB::new_inmemory(); + let mut db2 = TaskDb::new_inmemory(); if let Some(ref o) = setup { db2.apply(o.clone()).unwrap(); } @@ -307,8 +307,8 @@ mod test { fn transform_invariant_holds(o1 in operation_strategy(), o2 in operation_strategy()) { let (o1p, o2p) = Operation::transform(o1.clone(), o2.clone()); - let mut db1 = TaskDB::new(Box::new(InMemoryStorage::new())); - let mut db2 = TaskDB::new(Box::new(InMemoryStorage::new())); + let mut db1 = TaskDb::new(Box::new(InMemoryStorage::new())); + let mut db2 = TaskDb::new(Box::new(InMemoryStorage::new())); // Ensure that any expected tasks already exist if let Operation::Update{ ref uuid, .. } = o1 { diff --git a/taskchampion/src/taskdb.rs b/taskchampion/src/taskdb.rs index ed728b8e6..f4850f487 100644 --- a/taskchampion/src/taskdb.rs +++ b/taskchampion/src/taskdb.rs @@ -7,10 +7,10 @@ use std::collections::HashSet; use std::str; use uuid::Uuid; -/// A TaskDB is the backend for a replica. It manages the storage, operations, synchronization, +/// A TaskDb is the backend for a replica. It manages the storage, operations, synchronization, /// and so on, and all the invariants that come with it. It leaves the meaning of particular task /// properties to the replica and task implementations. -pub struct TaskDB { +pub struct TaskDb { storage: Box, } @@ -19,24 +19,24 @@ struct Version { operations: Vec, } -impl TaskDB { - /// Create a new TaskDB with the given backend storage - pub fn new(storage: Box) -> TaskDB { - TaskDB { storage } +impl TaskDb { + /// Create a new TaskDb with the given backend storage + pub fn new(storage: Box) -> TaskDb { + TaskDb { storage } } #[cfg(test)] - pub fn new_inmemory() -> TaskDB { - TaskDB::new(Box::new(crate::storage::InMemoryStorage::new())) + pub fn new_inmemory() -> TaskDb { + TaskDb::new(Box::new(crate::storage::InMemoryStorage::new())) } - /// Apply an operation to the TaskDB. Aside from synchronization operations, this is the only way - /// to modify the TaskDB. In cases where an operation does not make sense, this function will do - /// nothing and return an error (but leave the TaskDB in a consistent state). + /// Apply an operation to the TaskDb. Aside from synchronization operations, this is the only way + /// to modify the TaskDb. In cases where an operation does not make sense, this function will do + /// nothing and return an error (but leave the TaskDb in a consistent state). pub fn apply(&mut self, op: Operation) -> anyhow::Result<()> { // TODO: differentiate error types here? let mut txn = self.storage.txn()?; - if let err @ Err(_) = TaskDB::apply_op(txn.as_mut(), &op) { + if let err @ Err(_) = TaskDb::apply_op(txn.as_mut(), &op) { return err; } txn.add_operation(op)?; @@ -49,12 +49,12 @@ impl TaskDB { Operation::Create { uuid } => { // insert if the task does not already exist if !txn.create_task(*uuid)? { - return Err(Error::DBError(format!("Task {} already exists", uuid)).into()); + return Err(Error::DbError(format!("Task {} already exists", uuid)).into()); } } Operation::Delete { ref uuid } => { if !txn.delete_task(*uuid)? { - return Err(Error::DBError(format!("Task {} does not exist", uuid)).into()); + return Err(Error::DbError(format!("Task {} does not exist", uuid)).into()); } } Operation::Update { @@ -71,7 +71,7 @@ impl TaskDB { }; txn.set_task(*uuid, task)?; } else { - return Err(Error::DBError(format!("Task {} does not exist", uuid)).into()); + return Err(Error::DbError(format!("Task {} does not exist", uuid)).into()); } } } @@ -213,7 +213,7 @@ impl TaskDB { // apply this verison and update base_version in storage info!("applying version {:?} from server", version_id); - TaskDB::apply_version(txn.as_mut(), version)?; + TaskDb::apply_version(txn.as_mut(), version)?; txn.set_base_version(version_id)?; base_version_id = version_id; } else { @@ -313,7 +313,7 @@ impl TaskDB { } } if let Some(o) = svr_op { - if let Err(e) = TaskDB::apply_op(txn, &o) { + if let Err(e) = TaskDb::apply_op(txn, &o) { warn!("Invalid operation when syncing: {} (ignored)", e); } } @@ -367,7 +367,7 @@ mod tests { #[test] fn test_apply_create() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op = Operation::Create { uuid }; db.apply(op.clone()).unwrap(); @@ -378,7 +378,7 @@ mod tests { #[test] fn test_apply_create_exists() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op = Operation::Create { uuid }; db.apply(op.clone()).unwrap(); @@ -393,7 +393,7 @@ mod tests { #[test] fn test_apply_create_update() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op1 = Operation::Create { uuid }; db.apply(op1.clone()).unwrap(); @@ -414,7 +414,7 @@ mod tests { #[test] fn test_apply_create_update_delete_prop() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op1 = Operation::Create { uuid }; db.apply(op1.clone()).unwrap(); @@ -456,7 +456,7 @@ mod tests { #[test] fn test_apply_update_does_not_exist() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op = Operation::Update { uuid, @@ -475,7 +475,7 @@ mod tests { #[test] fn test_apply_create_delete() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op1 = Operation::Create { uuid }; db.apply(op1.clone()).unwrap(); @@ -489,7 +489,7 @@ mod tests { #[test] fn test_apply_delete_not_present() { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let uuid = Uuid::new_v4(); let op1 = Operation::Delete { uuid }; @@ -513,7 +513,7 @@ mod tests { } fn rebuild_working_set(renumber: bool) -> anyhow::Result<()> { - let mut db = TaskDB::new_inmemory(); + let mut db = TaskDb::new_inmemory(); let mut uuids = vec![]; uuids.push(Uuid::new_v4()); println!("uuids[0]: {:?} - pending, not in working set", uuids[0]); @@ -526,7 +526,7 @@ mod tests { uuids.push(Uuid::new_v4()); println!("uuids[4]: {:?} - pending, in working set", uuids[4]); - // add everything to the TaskDB + // add everything to the TaskDb for uuid in &uuids { db.apply(Operation::Create { uuid: *uuid })?; } @@ -598,8 +598,8 @@ mod tests { Ok(()) } - fn newdb() -> TaskDB { - TaskDB::new(Box::new(InMemoryStorage::new())) + fn newdb() -> TaskDb { + TaskDb::new(Box::new(InMemoryStorage::new())) } #[test] @@ -751,7 +751,7 @@ mod tests { #[test] // check that various sequences of operations on mulitple db's do not get the db's into an // incompatible state. The main concern here is that there might be a sequence of create - // and delete operations that results in a task existing in one TaskDB but not existing in + // and delete operations that results in a task existing in one TaskDb but not existing in // another. So, the generated sequences focus on a single task UUID. fn transform_sequences_of_operations(action_sequence in action_sequence_strategy()) { let mut server: Box = Box::new(TestServer::new());