From 982b972d3bbd1dfabfd0bd52bca318352fadd34f Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 15 Jun 2023 10:34:54 +0800 Subject: [PATCH] Fix formatting. --- CHANGELOG.md | 5 +++++ src/config/hashing.rs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5d5538..8fb82683 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Rhai Release Notes Version 1.15.0 ============== +Bug fixes +--------- + +* Fixes a concurrency error in static hashing keys (thanks [`garypen`](https://github.com/garypen)!). + Enhancements ------------ diff --git a/src/config/hashing.rs b/src/config/hashing.rs index 95005eab..38bab240 100644 --- a/src/config/hashing.rs +++ b/src/config/hashing.rs @@ -51,9 +51,9 @@ impl HokmaLock { pub fn write(&'static self) -> WhenTheHokmaSuppression { loop { // We are only interested in error results - if let Err(previous) = self - .lock - .compare_exchange(1, 1, Ordering::SeqCst, Ordering::SeqCst) + if let Err(previous) = + self.lock + .compare_exchange(1, 1, Ordering::SeqCst, Ordering::SeqCst) { // If we failed, previous cannot be 1 return WhenTheHokmaSuppression {