diff options
| author | metamuffin <metamuffin@disroot.org> | 2026-01-24 23:06:33 +0100 |
|---|---|---|
| committer | metamuffin <metamuffin@disroot.org> | 2026-01-24 23:06:33 +0100 |
| commit | 2bcccb18a6cb8bf836f57c3d86f759b19699def2 (patch) | |
| tree | ef55a10c6d9703677a983b8ca900fb4578a08eb3 /cache/src/lib.rs | |
| parent | b2e88a8beabf04adc28947cf82996e8692a68b71 (diff) | |
| download | jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.bz2 jellything-2bcccb18a6cb8bf836f57c3d86f759b19699def2.tar.zst | |
cache as object
Diffstat (limited to 'cache/src/lib.rs')
| -rw-r--r-- | cache/src/lib.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cache/src/lib.rs b/cache/src/lib.rs index be2b331..4d6bbcf 100644 --- a/cache/src/lib.rs +++ b/cache/src/lib.rs @@ -81,14 +81,10 @@ impl Cache { Ok(out) } - pub fn cache_read(&self, key: &str) -> Result<Option<Vec<u8>>> { + pub fn read(&self, key: &str) -> Result<Option<Vec<u8>>> { self.storage.read(key) } - pub fn cache_store( - &self, - key: String, - generate: impl FnOnce() -> Result<Vec<u8>>, - ) -> Result<String> { + pub fn store(&self, key: String, generate: impl FnOnce() -> Result<Vec<u8>>) -> Result<String> { self.cache(&key, generate)?; Ok(key) } |