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;
77
88use std:: { borrow:: Cow , str:: FromStr } ;
99
10- use bson:: { Bson , Document } ;
10+ use bson:: Document ;
1111use rand:: Rng ;
1212use typed_builder:: TypedBuilder ;
1313
@@ -198,8 +198,10 @@ pub struct Credential {
198198}
199199
200200impl Credential {
201- #[ allow ( dead_code ) ]
201+ #[ cfg ( test ) ]
202202 pub ( crate ) fn into_document ( mut self ) -> Document {
203+ use bson:: Bson ;
204+
203205 let mut doc = Document :: new ( ) ;
204206
205207 if let Some ( s) = self . username . take ( ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,6 @@ impl Client {
4848 /// Execute the given operation, optionally specifying a connection used to do so.
4949 /// If no connection is provided, server selection will performed using the criteria specified
5050 /// on the operation, if any.
51- #[ allow( dead_code) ]
5251 pub ( crate ) fn execute_operation < T : Operation > (
5352 & self ,
5453 op : & T ,
Original file line number Diff line number Diff line change @@ -166,17 +166,14 @@ impl Client {
166166 }
167167 }
168168
169- #[ allow( dead_code) ]
170169 pub ( crate ) fn send_command_started_event ( & self , event : CommandStartedEvent ) {
171170 self . emit_command_event ( |handler| handler. handle_command_started_event ( event. clone ( ) ) ) ;
172171 }
173172
174- #[ allow( dead_code) ]
175173 pub ( crate ) fn send_command_succeeded_event ( & self , event : CommandSucceededEvent ) {
176174 self . emit_command_event ( |handler| handler. handle_command_succeeded_event ( event. clone ( ) ) ) ;
177175 }
178176
179- #[ allow( dead_code) ]
180177 pub ( crate ) fn send_command_failed_event ( & self , event : CommandFailedEvent ) {
181178 self . emit_command_event ( |handler| handler. handle_command_failed_event ( event. clone ( ) ) ) ;
182179 }
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl Count {
2222 Count { ns, options }
2323 }
2424
25- #[ allow ( dead_code ) ]
25+ #[ cfg ( test ) ]
2626 pub ( crate ) fn empty ( ) -> Self {
2727 Count {
2828 ns : Namespace {
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pub(crate) struct Create {
1818}
1919
2020impl Create {
21- #[ allow ( dead_code ) ]
21+ #[ cfg ( test ) ]
2222 fn empty ( ) -> Self {
2323 Self :: new (
2424 Namespace {
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pub(crate) struct Delete {
2323}
2424
2525impl Delete {
26- #[ allow ( dead_code ) ]
26+ #[ cfg ( test ) ]
2727 fn empty ( ) -> Self {
2828 Self :: new (
2929 Namespace {
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ impl Distinct {
3434 }
3535 }
3636
37- #[ allow ( dead_code ) ]
37+ #[ cfg ( test ) ]
3838 pub ( crate ) fn empty ( ) -> Self {
3939 Distinct {
4040 ns : Namespace {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ impl DropCollection {
2222 DropCollection { ns, options }
2323 }
2424
25- #[ allow ( dead_code ) ]
25+ #[ cfg ( test ) ]
2626 fn empty ( ) -> Self {
2727 Self :: new (
2828 Namespace {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ pub(crate) struct DropDatabase {
1717}
1818
1919impl DropDatabase {
20- #[ allow ( dead_code ) ]
20+ #[ cfg ( test ) ]
2121 fn empty ( ) -> Self {
2222 Self :: new ( String :: new ( ) , None )
2323 }
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub(crate) struct Find {
2020}
2121
2222impl Find {
23- #[ allow ( dead_code ) ]
23+ #[ cfg ( test ) ]
2424 fn empty ( ) -> Self {
2525 Self :: new (
2626 Namespace {
You can’t perform that action at this time.
0 commit comments