From 798bc745507a6d80545bccd114d06b58d3c839ac Mon Sep 17 00:00:00 2001 From: Foreverhighness Date: Wed, 30 Oct 2024 15:57:33 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(BoC):=20Use=20`PinBox`=20instead?= =?UTF-8?q?=20of=20`Vec`=20to=20avoid=20unintentional=20move.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- homework/src/boc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homework/src/boc.rs b/homework/src/boc.rs index a6677f72cbb..02b58703d4c 100644 --- a/homework/src/boc.rs +++ b/homework/src/boc.rs @@ -1,6 +1,7 @@ //! Concurrent Owner (Cown) type. use core::cell::UnsafeCell; +use core::pin::Pin; use core::sync::atomic::Ordering::SeqCst; use core::sync::atomic::{AtomicBool, AtomicPtr, AtomicUsize}; use core::{fmt, hint, ptr}; @@ -167,7 +168,7 @@ struct Behavior { /// Number of not-yet enqueued requests. count: AtomicUsize, /// The requests for this behavior. - requests: Vec, + requests: Pin>, } impl Behavior {