@@ -85,11 +85,19 @@ impl Drop for DatabaseInner {
8585
8686 // IMPORTANT: Break cyclic Arcs
8787 self . supervisor . flush_manager . clear ( ) ;
88+ #[ expect(
89+ clippy:: expect_used,
90+ reason = "Drop impl cannot propagate errors from poisoned locks"
91+ ) ]
8892 self . supervisor
8993 . keyspaces
9094 . write ( )
9195 . expect ( "lock is poisoned" )
9296 . clear ( ) ;
97+ #[ expect(
98+ clippy:: expect_used,
99+ reason = "Drop impl cannot propagate errors from poisoned locks"
100+ ) ]
93101 self . supervisor
94102 . journal_manager
95103 . write ( )
@@ -277,7 +285,12 @@ impl Database {
277285 /// # Ok::<(), fjall::Error>(())
278286 /// ```
279287 #[ must_use]
288+ #[ expect(
289+ clippy:: missing_panics_doc,
290+ reason = "panics only if internal RwLock is poisoned"
291+ ) ]
280292 pub fn journal_count ( & self ) -> usize {
293+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
281294 self . supervisor
282295 . journal_manager
283296 . read ( )
@@ -288,6 +301,7 @@ impl Database {
288301 /// Returns the disk space usage of the journal.
289302 #[ doc( hidden) ]
290303 pub fn journal_disk_space ( & self ) -> crate :: Result < u64 > {
304+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
291305 Ok ( self . supervisor . journal . get_writer ( ) . len ( ) ?
292306 + self
293307 . supervisor
@@ -311,9 +325,18 @@ impl Database {
311325 /// #
312326 /// # Ok::<(), fjall::Error>(())
313327 /// ```
328+ ///
329+ /// # Errors
330+ ///
331+ /// Returns an error if an IO error occurs.
332+ #[ expect(
333+ clippy:: missing_panics_doc,
334+ reason = "panics only if internal RwLock is poisoned"
335+ ) ]
314336 pub fn disk_space ( & self ) -> crate :: Result < u64 > {
315337 let journal_size = self . journal_disk_space ( ) ?;
316338
339+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
317340 let keyspaces_size = self
318341 . supervisor
319342 . keyspaces
@@ -349,7 +372,7 @@ impl Database {
349372 ///
350373 /// # Errors
351374 ///
352- /// Returns error, if an IO error occurred .
375+ /// Returns an error if an IO error occurs .
353376 pub fn persist ( & self , mode : PersistMode ) -> crate :: Result < ( ) > {
354377 if self . is_poisoned . load ( std:: sync:: atomic:: Ordering :: Relaxed ) {
355378 return Err ( crate :: Error :: Poisoned ) ;
@@ -385,7 +408,7 @@ impl Database {
385408 ///
386409 /// # Errors
387410 ///
388- /// Returns error, if an IO error occurred .
411+ /// Returns an error if an IO error occurs .
389412 pub fn open ( config : Config ) -> crate :: Result < Self > {
390413 log:: debug!(
391414 "cache capacity={}MiB" ,
@@ -443,7 +466,7 @@ impl Database {
443466 ///
444467 /// # Errors
445468 ///
446- /// Returns error, if an IO error occurred .
469+ /// Returns an error if an IO error occurs .
447470 ///
448471 /// # Panics
449472 ///
@@ -455,6 +478,7 @@ impl Database {
455478 ) -> crate :: Result < Keyspace > {
456479 assert ! ( is_valid_keyspace_name( name) ) ;
457480
481+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
458482 let keyspaces = self . supervisor . keyspaces . write ( ) . expect ( "lock is poisoned" ) ;
459483
460484 Ok ( if let Some ( keyspace) = keyspaces. get ( name) {
@@ -490,7 +514,12 @@ impl Database {
490514
491515 /// Returns the number of keyspaces.
492516 #[ must_use]
517+ #[ expect(
518+ clippy:: missing_panics_doc,
519+ reason = "panics only if internal RwLock is poisoned"
520+ ) ]
493521 pub fn keyspace_count ( & self ) -> usize {
522+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
494523 self . supervisor
495524 . keyspaces
496525 . read ( )
@@ -500,7 +529,12 @@ impl Database {
500529
501530 /// Gets a list of all keyspace names in the database.
502531 #[ must_use]
532+ #[ expect(
533+ clippy:: missing_panics_doc,
534+ reason = "panics only if internal RwLock is poisoned"
535+ ) ]
503536 pub fn list_keyspace_names ( & self ) -> Vec < KeyspaceKey > {
537+ #[ expect( clippy:: expect_used, reason = "poisoned lock is unrecoverable" ) ]
504538 self . supervisor
505539 . keyspaces
506540 . read ( )
@@ -771,6 +805,10 @@ impl Database {
771805
772806 db. supervisor . snapshot_tracker . gc ( ) ;
773807
808+ #[ expect(
809+ clippy:: expect_used,
810+ reason = "poisoned lock during recovery is unrecoverable"
811+ ) ]
774812 for keyspace in db
775813 . supervisor
776814 . keyspaces
0 commit comments