use conduit::Result; #[inline] pub(crate) fn result(r: std::result::Result) -> Result { r.map_or_else(or_else, and_then) } #[inline(always)] pub(crate) fn and_then(t: T) -> Result { Ok(t) } pub(crate) fn or_else(e: rocksdb::Error) -> Result { Err(map_err(e)) } pub(crate) fn map_err(e: rocksdb::Error) -> conduit::Error { conduit::Error::Database(e.into_string()) }