diff --git a/src/pager/core.rs b/src/pager/core.rs index 0b3daad..d11b264 100644 --- a/src/pager/core.rs +++ b/src/pager/core.rs @@ -389,7 +389,7 @@ impl Pager { &self.vfs } - #[allow(clippy::unused_async)] + #[allow(clippy::unused_async, clippy::unused_async_trait_impl)] pub async fn open(vfs: V, mk: MasterKey, cfg: PagerConfig) -> Result { let inner = Arc::new(PagerInner { buffer_pool: parking_lot::Mutex::new(PageCache::with_capacity(cfg.buffer_pool_pages)), @@ -542,7 +542,7 @@ impl Pager { /// Write (insert into cache as dirty) a main.db page. The copy-on-write caller has /// already chosen `page_id`. `body_plain` is the plaintext payload /// (length must equal `page_size - 40`). - #[allow(clippy::unused_async)] + #[allow(clippy::unused_async, clippy::unused_async_trait_impl)] pub async fn write_main_page( &self, page_id: u64, @@ -567,7 +567,7 @@ impl Pager { /// page 0 is the segment header, allocated separately by the segment /// writer in a later slice). Test-only; see [`Self::read_segment_page`]. #[cfg(test)] - #[allow(clippy::unused_async)] + #[allow(clippy::unused_async, clippy::unused_async_trait_impl)] pub async fn append_segment_page( &self, segment_id: [u8; 16], @@ -610,7 +610,7 @@ impl Pager { /// native-only (filesystem-backed VFS root); on wasm32 it never compiles /// in, leaving this unreachable there. #[cfg(not(target_arch = "wasm32"))] - #[allow(clippy::unused_async)] + #[allow(clippy::unused_async, clippy::unused_async_trait_impl)] pub async fn stage_journal_page( &self, journal_id: [u8; 16], diff --git a/src/vfs/memory.rs b/src/vfs/memory.rs index 064abe4..ed7e8be 100644 --- a/src/vfs/memory.rs +++ b/src/vfs/memory.rs @@ -106,6 +106,9 @@ pub struct MemFile { writable: bool, } +// These methods implement an async storage contract. Some finish immediately +// in memory, but keeping the trait-shaped futures avoids a backend-specific API. +#[allow(clippy::unused_async_trait_impl)] impl Vfs for MemVfs { type File = MemFile; type LockHandle = MemLockHandle; @@ -221,6 +224,7 @@ impl Vfs for MemVfs { } } +#[allow(clippy::unused_async_trait_impl)] impl VfsFile for MemFile { async fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result { let inode = self.inode.lock(); diff --git a/src/vfs/opfs/mod.rs b/src/vfs/opfs/mod.rs index b00b588..578aeae 100644 --- a/src/vfs/opfs/mod.rs +++ b/src/vfs/opfs/mod.rs @@ -81,6 +81,9 @@ mod shim { pub struct OpfsFileShim; + // The native shim preserves the async VFS surface while refusing every + // operation immediately. + #[allow(clippy::unused_async_trait_impl)] impl VfsFile for OpfsFileShim { async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> Result { Err(PagedbError::Unsupported) @@ -114,6 +117,7 @@ mod shim { /// Unreachable lock handle for the native shim. pub struct OpfsLockHandleShim(()); + #[allow(clippy::unused_async_trait_impl)] impl Vfs for OpfsVfs { type File = OpfsFileShim; type LockHandle = OpfsLockHandleShim; diff --git a/src/vfs/traits.rs b/src/vfs/traits.rs index bec37ee..9f5b169 100644 --- a/src/vfs/traits.rs +++ b/src/vfs/traits.rs @@ -596,6 +596,8 @@ mod tests { } } + // This synchronous test double implements the production async contract. + #[allow(clippy::unused_async_trait_impl)] impl VfsFile for ScriptedWriteFile { async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> crate::Result { unimplemented!("read_at is not used by write_all_at tests") diff --git a/src/vfs/wasi.rs b/src/vfs/wasi.rs index 2a49103..df89ade 100644 --- a/src/vfs/wasi.rs +++ b/src/vfs/wasi.rs @@ -459,6 +459,9 @@ mod shim { pub struct WasiFileShim; + // The non-WASI shim preserves the async VFS surface while refusing every + // operation immediately. + #[allow(clippy::unused_async_trait_impl)] impl VfsFile for WasiFileShim { async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> Result { Err(PagedbError::Unsupported) @@ -492,6 +495,7 @@ mod shim { /// Unreachable lock handle for the non-WASI shim. pub struct WasiLockHandleShim(()); + #[allow(clippy::unused_async_trait_impl)] impl Vfs for WasiVfs { type File = WasiFileShim; type LockHandle = WasiLockHandleShim;