Skip to content

Commit 9d7fd1b

Browse files
committed
_leak_checker moved to last field of structs
1 parent 38bd84f commit 9d7fd1b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/utils.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ fn generate_replication_configuration(
154154
#[cfg(feature = "enterprise")]
155155
pub struct ReplicationTwoDbsTester {
156156
_tmp_dir: TempDir,
157-
_leak_checker: LeakChecker,
158157
pub local_database: Database,
159158
central_database: Database,
160159
replicator: Replicator,
161160
replicator_continuous: bool,
161+
// Keep _leak_checker at the end, fields in a struct are dropped in declaration order
162+
_leak_checker: LeakChecker,
162163
}
163164

164165
#[cfg(feature = "enterprise")]
@@ -206,11 +207,11 @@ impl ReplicationTwoDbsTester {
206207
// Return
207208
Self {
208209
_tmp_dir: tmp_dir,
209-
_leak_checker: LeakChecker::new(),
210210
local_database,
211211
central_database,
212212
replicator,
213213
replicator_continuous,
214+
_leak_checker: LeakChecker::new(),
214215
}
215216
}
216217

@@ -279,14 +280,15 @@ impl Drop for ReplicationTwoDbsTester {
279280
#[cfg(feature = "enterprise")]
280281
pub struct ReplicationThreeDbsTester {
281282
_tmp_dir: TempDir,
282-
_leak_checker: LeakChecker,
283283
local_database_1: Database,
284284
local_database_2: Database,
285285
central_database: Database,
286286
replicator_1: Replicator,
287287
replicator_1_continuous: bool,
288288
replicator_2: Replicator,
289289
replicator_2_continuous: bool,
290+
// Keep _leak_checker at the end, fields in a struct are dropped in declaration order
291+
_leak_checker: LeakChecker,
290292
}
291293

292294
#[cfg(feature = "enterprise")]
@@ -353,14 +355,14 @@ impl ReplicationThreeDbsTester {
353355
// Return
354356
Self {
355357
_tmp_dir: tmp_dir,
356-
_leak_checker: LeakChecker::new(),
357358
local_database_1,
358359
local_database_2,
359360
central_database,
360361
replicator_1,
361362
replicator_1_continuous,
362363
replicator_2,
363364
replicator_2_continuous,
365+
_leak_checker: LeakChecker::new(),
364366
}
365367
}
366368

0 commit comments

Comments
 (0)