@@ -26,7 +26,7 @@ use crate::txn::{TlsUsage, WithoutTls};
2626use crate :: { EnvFlags , Error , Result , WithTls } ;
2727
2828/// Options and flags which can be used to configure how an environment is opened.
29- #[ derive( Clone , Debug , PartialEq , Eq ) ]
29+ #[ derive( Debug , PartialEq , Eq ) ]
3030#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
3131pub struct EnvOpenOptions < T : TlsUsage > {
3232 map_size : Option < usize > ,
@@ -36,12 +36,6 @@ pub struct EnvOpenOptions<T: TlsUsage> {
3636 _tls_marker : PhantomData < T > ,
3737}
3838
39- impl Default for EnvOpenOptions < WithTls > {
40- fn default ( ) -> Self {
41- Self :: new ( )
42- }
43- }
44-
4539impl EnvOpenOptions < WithTls > {
4640 /// Creates a blank new set of options ready for configuration.
4741 pub fn new ( ) -> EnvOpenOptions < WithTls > {
@@ -136,9 +130,6 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
136130 let Self { map_size, max_readers, max_dbs, flags, _tls_marker : _ } = self ;
137131 EnvOpenOptions { map_size, max_readers, max_dbs, flags, _tls_marker : PhantomData }
138132 }
139- }
140-
141- impl < T : TlsUsage > EnvOpenOptions < T > {
142133 /// Set the size of the memory map to use for this environment.
143134 ///
144135 /// It must be a multiple of the OS page size.
@@ -494,3 +485,16 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
494485 }
495486 }
496487}
488+
489+ impl Default for EnvOpenOptions < WithTls > {
490+ fn default ( ) -> Self {
491+ Self :: new ( )
492+ }
493+ }
494+
495+ impl < T : TlsUsage > Clone for EnvOpenOptions < T > {
496+ fn clone ( & self ) -> Self {
497+ let Self { map_size, max_readers, max_dbs, flags, _tls_marker } = * self ;
498+ EnvOpenOptions { map_size, max_readers, max_dbs, flags, _tls_marker }
499+ }
500+ }
0 commit comments