File tree Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Expand file tree Collapse file tree 2 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -681,9 +681,10 @@ impl ClientOptions {
681681 /// used in the SRV tests.
682682 #[ cfg( test) ]
683683 pub ( crate ) fn new_srv ( ) -> Self {
684- let mut options = Self :: default ( ) ;
685- options. original_srv_hostname = Some ( "localhost.test.test.build.10gen.cc" . into ( ) ) ;
686- options
684+ Self {
685+ original_srv_hostname : Some ( "localhost.test.test.build.10gen.cc" . into ( ) ) ,
686+ ..Default :: default ( )
687+ }
687688 }
688689
689690 /// Parses a MongoDB connection string into a ClientOptions struct. If the string is malformed
Original file line number Diff line number Diff line change @@ -122,20 +122,22 @@ async fn concurrent_connections() {
122122 } ) ;
123123 futures:: future:: join_all ( tasks) . await ;
124124
125- // ensure all three ConnectionCreatedEvents were emitted before one ConnectionReadyEvent.
126- let events = handler. events . read ( ) . unwrap ( ) ;
127- let mut consecutive_creations = 0 ;
128- for event in events. iter ( ) {
129- match event {
130- Event :: ConnectionCreated ( _) => {
131- consecutive_creations += 1 ;
132- }
133- Event :: ConnectionReady ( _) => {
134- if consecutive_creations < 2 {
135- panic ! ( "connections not created concurrently" ) ;
125+ {
126+ // ensure all three ConnectionCreatedEvents were emitted before one ConnectionReadyEvent.
127+ let events = handler. events . read ( ) . unwrap ( ) ;
128+ let mut consecutive_creations = 0 ;
129+ for event in events. iter ( ) {
130+ match event {
131+ Event :: ConnectionCreated ( _) => {
132+ consecutive_creations += 1 ;
133+ }
134+ Event :: ConnectionReady ( _) => {
135+ if consecutive_creations < 2 {
136+ panic ! ( "connections not created concurrently" ) ;
137+ }
136138 }
139+ _ => ( ) ,
137140 }
138- _ => ( ) ,
139141 }
140142 }
141143
You can’t perform that action at this time.
0 commit comments