Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
173 stars 8 forks source link

Add `DbClosedError` #88

Closed GodTamIt closed 10 months ago

GodTamIt commented 10 months ago

This adds a new exception type for when the instance is already closed.

It also cleans up common access patterns to be more succinct:

let db = self.get_db()?;

instead of

if let Some(db) = &self.db {
   unimplemented!("Some code here")
} else {
    Err(...)
}
Congyuwang commented 10 months ago

Thanks for contributing. This is very nice!