@@ -114,26 +114,6 @@ pub enum WriteMode {
114
114
flush_interval : Duration ,
115
115
} ,
116
116
}
117
-
118
- pub ( crate ) enum EffectiveWriteMode {
119
- Direct ,
120
- #[ allow( dead_code) ] // introduced due to a bug in clippy, should be removed again
121
- BufferAndFlushWith ( usize , Duration ) ,
122
- #[ cfg_attr( docsrs, doc( cfg( feature = "async" ) ) ) ]
123
- #[ cfg( feature = "async" ) ]
124
- AsyncWith {
125
- /// Capacity of the pool for the message buffers.
126
- pool_capa : usize ,
127
- /// Capacity of an individual message buffer.
128
- message_capa : usize ,
129
- /// The interval for flushing the output.
130
- ///
131
- /// With `Duration::ZERO` flushing is suppressed.
132
- flush_interval : Duration ,
133
- } ,
134
- BufferDontFlushWith ( usize ) ,
135
- }
136
-
137
117
impl WriteMode {
138
118
pub ( crate ) fn inner ( & self ) -> EffectiveWriteMode {
139
119
match * self {
@@ -144,12 +124,9 @@ impl WriteMode {
144
124
Self :: BufferDontFlushWith ( duration) => {
145
125
EffectiveWriteMode :: BufferDontFlushWith ( duration)
146
126
}
147
- Self :: BufferAndFlush => EffectiveWriteMode :: BufferAndFlushWith (
148
- DEFAULT_BUFFER_CAPACITY ,
149
- DEFAULT_FLUSH_INTERVAL ,
150
- ) ,
151
- Self :: BufferAndFlushWith ( bufsize, duration) => {
152
- EffectiveWriteMode :: BufferAndFlushWith ( bufsize, duration)
127
+ Self :: BufferAndFlush => EffectiveWriteMode :: BufferAndFlushWith ( DEFAULT_BUFFER_CAPACITY ) ,
128
+ Self :: BufferAndFlushWith ( bufsize, _duration) => {
129
+ EffectiveWriteMode :: BufferAndFlushWith ( bufsize)
153
130
}
154
131
#[ cfg( feature = "async" ) ]
155
132
Self :: Async => EffectiveWriteMode :: AsyncWith {
@@ -198,7 +175,7 @@ impl WriteMode {
198
175
pub ( crate ) fn buffersize ( & self ) -> Option < usize > {
199
176
match self . inner ( ) {
200
177
EffectiveWriteMode :: Direct => None ,
201
- EffectiveWriteMode :: BufferAndFlushWith ( bufsize, _ )
178
+ EffectiveWriteMode :: BufferAndFlushWith ( bufsize)
202
179
| EffectiveWriteMode :: BufferDontFlushWith ( bufsize) => Some ( bufsize) ,
203
180
#[ cfg( feature = "async" ) ]
204
181
EffectiveWriteMode :: AsyncWith {
@@ -227,3 +204,21 @@ impl WriteMode {
227
204
}
228
205
}
229
206
}
207
+
208
+ pub ( crate ) enum EffectiveWriteMode {
209
+ Direct ,
210
+ BufferAndFlushWith ( usize ) ,
211
+ #[ cfg_attr( docsrs, doc( cfg( feature = "async" ) ) ) ]
212
+ #[ cfg( feature = "async" ) ]
213
+ AsyncWith {
214
+ /// Capacity of the pool for the message buffers.
215
+ pool_capa : usize ,
216
+ /// Capacity of an individual message buffer.
217
+ message_capa : usize ,
218
+ /// The interval for flushing the output.
219
+ ///
220
+ /// With `Duration::ZERO` flushing is suppressed.
221
+ flush_interval : Duration ,
222
+ } ,
223
+ BufferDontFlushWith ( usize ) ,
224
+ }
0 commit comments