mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-23 18:21:13 +08:00
fix: shared_buffer 测试 clippy redundant-pattern-matching
This commit is contained in:
@@ -411,10 +411,7 @@ mod tests {
|
|||||||
let handles: Vec<_> = (0..2)
|
let handles: Vec<_> = (0..2)
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
let buf = Arc::clone(&buf);
|
let buf = Arc::clone(&buf);
|
||||||
std::thread::spawn(move || match buf.compare_exchange_u32(0, 0, 1) {
|
std::thread::spawn(move || buf.compare_exchange_u32(0, 0, 1).is_ok())
|
||||||
Ok(_) => true,
|
|
||||||
Err(_) => false,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let winners = handles.into_iter().map(|h| h.join().unwrap()).filter(|won| *won).count();
|
let winners = handles.into_iter().map(|h| h.join().unwrap()).filter(|won| *won).count();
|
||||||
|
|||||||
Reference in New Issue
Block a user