mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Add extensive commentary on mutable to the processor's main file
Clearly establishes why consistency is guaranteed from a Rust borrow-checker mindset. While there are plenty of... 'violations', they're clearly explained. Hopefully, this method of thinking helps promote/ensure consistency in the future.
This commit is contained in:
@@ -27,7 +27,7 @@ pub async fn test_scanner<C: Coin>(coin: C) {
|
||||
let first = Arc::new(Mutex::new(true));
|
||||
let db = MemDb::new();
|
||||
let new_scanner = || async {
|
||||
let (scanner, active_keys) = Scanner::new(coin.clone(), db.clone());
|
||||
let (mut scanner, active_keys) = Scanner::new(coin.clone(), db.clone());
|
||||
let mut first = first.lock().unwrap();
|
||||
if *first {
|
||||
assert!(active_keys.is_empty());
|
||||
|
||||
Reference in New Issue
Block a user