@@ -26,7 +26,7 @@ use crate::txn::{TlsUsage, WithoutTls};
26
26
use crate :: { EnvFlags , Error , Result , WithTls } ;
27
27
28
28
/// 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 ) ]
30
30
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
31
31
pub struct EnvOpenOptions < T : TlsUsage > {
32
32
map_size : Option < usize > ,
@@ -36,12 +36,6 @@ pub struct EnvOpenOptions<T: TlsUsage> {
36
36
_tls_marker : PhantomData < T > ,
37
37
}
38
38
39
- impl Default for EnvOpenOptions < WithTls > {
40
- fn default ( ) -> Self {
41
- Self :: new ( )
42
- }
43
- }
44
-
45
39
impl EnvOpenOptions < WithTls > {
46
40
/// Creates a blank new set of options ready for configuration.
47
41
pub fn new ( ) -> EnvOpenOptions < WithTls > {
@@ -136,9 +130,6 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
136
130
let Self { map_size, max_readers, max_dbs, flags, _tls_marker : _ } = self ;
137
131
EnvOpenOptions { map_size, max_readers, max_dbs, flags, _tls_marker : PhantomData }
138
132
}
139
- }
140
-
141
- impl < T : TlsUsage > EnvOpenOptions < T > {
142
133
/// Set the size of the memory map to use for this environment.
143
134
///
144
135
/// It must be a multiple of the OS page size.
@@ -494,3 +485,16 @@ impl<T: TlsUsage> EnvOpenOptions<T> {
494
485
}
495
486
}
496
487
}
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