From 4fa37deec5b8534d00d64aa8750b147ea7c5ae1d Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Mon, 7 Oct 2024 19:51:21 -0400 Subject: [PATCH] storage: remove `Clone` off write handle --- storage/blockchain/src/service/mod.rs | 7 +++---- storage/service/src/service/write.rs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/storage/blockchain/src/service/mod.rs b/storage/blockchain/src/service/mod.rs index 5fe4af9..53bf1df 100644 --- a/storage/blockchain/src/service/mod.rs +++ b/storage/blockchain/src/service/mod.rs @@ -21,10 +21,9 @@ //! //! The 2nd allows any caller to send [`WriteRequest`][req_w]s. //! -//! The [`BlockchainReadHandle`] can be shared as it is cheaply [`Clone`]able. -//! -//! Although [`BlockchainWriteHandle`] can also be cloned, there is only 1 place -//! in Cuprate that writes (the blockchain manager), so it is passed there and used. +//! The [`BlockchainReadHandle`] can be shared as it is cheaply [`Clone`]able, however, +//! the [`BlockchainWriteHandle`] cannot be cloned. There is only 1 place in Cuprate that +//! writes, so it is passed there and used. //! //! ## Initialization //! The database & thread-pool system can be initialized with [`init()`]. diff --git a/storage/service/src/service/write.rs b/storage/service/src/service/write.rs index d2cb862..f75d615 100644 --- a/storage/service/src/service/write.rs +++ b/storage/service/src/service/write.rs @@ -21,7 +21,7 @@ const WRITER_THREAD_NAME: &str = concat!(module_path!(), "::DatabaseWriter"); /// Calling [`tower::Service::call`] with a [`DatabaseWriteHandle`] /// will return an `async`hronous channel that can be `.await`ed upon /// to receive the corresponding response. -#[derive(Clone, Debug)] +#[derive(Debug)] pub struct DatabaseWriteHandle { /// Sender channel to the database write thread-pool. ///