diff options
author | Florian Klink <flokli@flokli.de> | 2023-12-12T19·25+0200 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-16T23·07+0000 |
commit | 923a5737e61da020e6d7672c3aebc00db9f44850 (patch) | |
tree | 9396103f55434b3819f032e28db1c53752a16497 /tvix/castore/src/directoryservice/utils.rs | |
parent | 36cc7b7088190d6fb53cb5ddddc31e6b56c25450 (diff) |
refactor(tvix/castore): drop is_closed() from impl DirectoryPutter r/7227
This is only used in the gRPC version (GRPCPutter), during the test automation. So define it as a method there, behind #[cfg(test)], and remove from the trait. Change-Id: Idf170884e3a10be0e96c75d946d9c431171e5e88 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10340 Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/castore/src/directoryservice/utils.rs')
-rw-r--r-- | tvix/castore/src/directoryservice/utils.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tvix/castore/src/directoryservice/utils.rs b/tvix/castore/src/directoryservice/utils.rs index 4c5e7cfde37c..ad9ce2535366 100644 --- a/tvix/castore/src/directoryservice/utils.rs +++ b/tvix/castore/src/directoryservice/utils.rs @@ -103,7 +103,7 @@ impl<DS: DirectoryService> SimplePutter<DS> { } #[async_trait] -impl<DS: DirectoryService> DirectoryPutter for SimplePutter<DS> { +impl<DS: DirectoryService + 'static> DirectoryPutter for SimplePutter<DS> { async fn put(&mut self, directory: proto::Directory) -> Result<(), Error> { if self.closed { return Err(Error::StorageError("already closed".to_string())); @@ -117,7 +117,6 @@ impl<DS: DirectoryService> DirectoryPutter for SimplePutter<DS> { Ok(()) } - /// We need to be mutable here, as that's the signature of the trait. async fn close(&mut self) -> Result<B3Digest, Error> { if self.closed { return Err(Error::StorageError("already closed".to_string())); @@ -133,8 +132,4 @@ impl<DS: DirectoryService> DirectoryPutter for SimplePutter<DS> { )), } } - - fn is_closed(&self) -> bool { - self.closed - } } |