@Kerollmops
Cow in Rust is mainly used for strings. Arc is trivially cloneable on the other hand, so it makes no sense to have sometimes Arc, sometimes &Arc.
|
env: Cow<'e, Arc<EnvInner>>, |
This Cow pollutes RoTxnInner, RoTxn and all other code using those structs with lifetimes.
I suggest changing this
struct RoTxnInner<'e> {
/// Makes the struct covariant and !Sync
pub(crate) txn: Option<NonNull<ffi::MDB_txn>>,
env: Cow<'e, Arc<EnvInner>>,
}
to this
struct RoTxnInner {
/// Makes the struct covariant and !Sync
pub(crate) txn: Option<NonNull<ffi::MDB_txn>>,
env: Arc<EnvInner>,
}
@Kerollmops
Cowin Rust is mainly used for strings. Arc is trivially cloneable on the other hand, so it makes no sense to have sometimesArc, sometimes&Arc.heed/heed/src/txn.rs
Line 59 in fdd105d
This
CowpollutesRoTxnInner,RoTxnand all other code using those structs with lifetimes.I suggest changing this
to this