|
18 | 18 | /// If a catastrophic error occurs, then the state will be poisoned. If the state is poisoned then that's |
19 | 19 | /// almost certainly an implementation bug, and should never happen. But in an abundance of caution it is |
20 | 20 | /// included to be safe. |
21 | | -#[derive(Debug, Clone, PartialEq)] |
| 21 | +#[derive(Clone, PartialEq, Debug)] |
22 | 22 | pub struct BorrowState { |
23 | 23 | /// The number of `&T` references that are tracked. |
24 | 24 | shared_count: usize, |
@@ -267,7 +267,7 @@ impl Default for BorrowState { |
267 | 267 | } |
268 | 268 | } |
269 | 269 |
|
270 | | -#[derive(Debug, Clone, PartialEq, Eq)] |
| 270 | +#[derive(Clone, Eq, PartialEq, Debug)] |
271 | 271 | pub enum BorrowStateErr { |
272 | 272 | Poisoned(String), |
273 | 273 | IsPoisoned, |
@@ -300,16 +300,19 @@ impl From<String> for BorrowStateErr { |
300 | 300 |
|
301 | 301 | #[cfg(all(test, feature = "proptest"))] |
302 | 302 | mod proptests { |
| 303 | + use proptest::arbitrary::Arbitrary; |
| 304 | + use proptest::collection::vec; |
| 305 | + use proptest::prelude::*; |
| 306 | + |
303 | 307 | use super::*; |
304 | | - use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; |
305 | 308 |
|
306 | 309 | impl BorrowState { |
307 | 310 | fn has_shared_reference(&self) -> bool { |
308 | 311 | self.shared_count > 0 |
309 | 312 | } |
310 | 313 | } |
311 | 314 |
|
312 | | - #[derive(Debug, Clone, Copy, PartialEq, Eq)] |
| 315 | + #[derive(Copy, Clone, Eq, PartialEq, Debug)] |
313 | 316 | enum Operation { |
314 | 317 | IncShared, |
315 | 318 | DecShared, |
@@ -362,7 +365,7 @@ mod proptests { |
362 | 365 | } |
363 | 366 | } |
364 | 367 |
|
365 | | - #[derive(Debug, Clone, PartialEq, Eq)] |
| 368 | + #[derive(Clone, Eq, PartialEq, Debug)] |
366 | 369 | struct OperationExecutor { |
367 | 370 | vec: Vec<Operation>, |
368 | 371 | } |
|
0 commit comments