File tree Expand file tree Collapse file tree 16 files changed +14
-35
lines changed Expand file tree Collapse file tree 16 files changed +14
-35
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ mod test;
7
7
8
8
use std:: { borrow:: Cow , str:: FromStr } ;
9
9
10
- use bson:: { Bson , Document } ;
10
+ use bson:: Document ;
11
11
use rand:: Rng ;
12
12
use typed_builder:: TypedBuilder ;
13
13
@@ -198,8 +198,10 @@ pub struct Credential {
198
198
}
199
199
200
200
impl Credential {
201
- #[ allow ( dead_code ) ]
201
+ #[ cfg ( test ) ]
202
202
pub ( crate ) fn into_document ( mut self ) -> Document {
203
+ use bson:: Bson ;
204
+
203
205
let mut doc = Document :: new ( ) ;
204
206
205
207
if let Some ( s) = self . username . take ( ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ impl Client {
48
48
/// Execute the given operation, optionally specifying a connection used to do so.
49
49
/// If no connection is provided, server selection will performed using the criteria specified
50
50
/// on the operation, if any.
51
- #[ allow( dead_code) ]
52
51
pub ( crate ) fn execute_operation < T : Operation > (
53
52
& self ,
54
53
op : & T ,
Original file line number Diff line number Diff line change @@ -166,17 +166,14 @@ impl Client {
166
166
}
167
167
}
168
168
169
- #[ allow( dead_code) ]
170
169
pub ( crate ) fn send_command_started_event ( & self , event : CommandStartedEvent ) {
171
170
self . emit_command_event ( |handler| handler. handle_command_started_event ( event. clone ( ) ) ) ;
172
171
}
173
172
174
- #[ allow( dead_code) ]
175
173
pub ( crate ) fn send_command_succeeded_event ( & self , event : CommandSucceededEvent ) {
176
174
self . emit_command_event ( |handler| handler. handle_command_succeeded_event ( event. clone ( ) ) ) ;
177
175
}
178
176
179
- #[ allow( dead_code) ]
180
177
pub ( crate ) fn send_command_failed_event ( & self , event : CommandFailedEvent ) {
181
178
self . emit_command_event ( |handler| handler. handle_command_failed_event ( event. clone ( ) ) ) ;
182
179
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl Count {
22
22
Count { ns, options }
23
23
}
24
24
25
- #[ allow ( dead_code ) ]
25
+ #[ cfg ( test ) ]
26
26
pub ( crate ) fn empty ( ) -> Self {
27
27
Count {
28
28
ns : Namespace {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub(crate) struct Create {
18
18
}
19
19
20
20
impl Create {
21
- #[ allow ( dead_code ) ]
21
+ #[ cfg ( test ) ]
22
22
fn empty ( ) -> Self {
23
23
Self :: new (
24
24
Namespace {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub(crate) struct Delete {
23
23
}
24
24
25
25
impl Delete {
26
- #[ allow ( dead_code ) ]
26
+ #[ cfg ( test ) ]
27
27
fn empty ( ) -> Self {
28
28
Self :: new (
29
29
Namespace {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl Distinct {
34
34
}
35
35
}
36
36
37
- #[ allow ( dead_code ) ]
37
+ #[ cfg ( test ) ]
38
38
pub ( crate ) fn empty ( ) -> Self {
39
39
Distinct {
40
40
ns : Namespace {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl DropCollection {
22
22
DropCollection { ns, options }
23
23
}
24
24
25
- #[ allow ( dead_code ) ]
25
+ #[ cfg ( test ) ]
26
26
fn empty ( ) -> Self {
27
27
Self :: new (
28
28
Namespace {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub(crate) struct DropDatabase {
17
17
}
18
18
19
19
impl DropDatabase {
20
- #[ allow ( dead_code ) ]
20
+ #[ cfg ( test ) ]
21
21
fn empty ( ) -> Self {
22
22
Self :: new ( String :: new ( ) , None )
23
23
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub(crate) struct Find {
20
20
}
21
21
22
22
impl Find {
23
- #[ allow ( dead_code ) ]
23
+ #[ cfg ( test ) ]
24
24
fn empty ( ) -> Self {
25
25
Self :: new (
26
26
Namespace {
You can’t perform that action at this time.
0 commit comments