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:
Luke Parker
2023-04-17 19:20:47 -04:00
parent 92a868e574
commit 059e79c98a
4 changed files with 293 additions and 178 deletions

View File

@@ -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());