THRIFT-5600: rust lib to upgrade to edition 2021
Client: rs
Patch: Jiayu Liu
This closes #2628
diff --git a/lib/rs/src/server/multiplexed.rs b/lib/rs/src/server/multiplexed.rs
index b447d38..f6811a4 100644
--- a/lib/rs/src/server/multiplexed.rs
+++ b/lib/rs/src/server/multiplexed.rs
@@ -271,10 +271,10 @@
_: &mut dyn TInputProtocol,
_: &mut dyn TOutputProtocol,
) -> crate::Result<()> {
- let res = self
- .invoked
- .compare_and_swap(false, true, Ordering::Relaxed);
- if res {
+ let res =
+ self.invoked
+ .compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed);
+ if res.is_ok() {
Ok(())
} else {
Err("failed swap".into())