Avoid the unused rights field

This commit is contained in:
Ruihan Li
2024-06-30 23:10:07 +08:00
committed by Tate, Hongliang Tian
parent 7621b71113
commit 9505e5704e

View File

@ -1,7 +1,5 @@
// SPDX-License-Identifier: MPL-2.0 // SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, AtomicU32, Ordering}; use core::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use aster_rights::{Read, ReadOp, TRights, Write, WriteOp}; use aster_rights::{Read, ReadOp, TRights, Write, WriteOp};
@ -29,8 +27,8 @@ impl<T> Channel<T> {
pub fn with_capacity_and_flags(capacity: usize, flags: StatusFlags) -> Result<Self> { pub fn with_capacity_and_flags(capacity: usize, flags: StatusFlags) -> Result<Self> {
let common = Arc::new(Common::with_capacity_and_flags(capacity, flags)?); let common = Arc::new(Common::with_capacity_and_flags(capacity, flags)?);
let producer = Producer(EndPoint::new(common.clone(), WriteOp::new())); let producer = Producer(EndPoint::new(common.clone()));
let consumer = Consumer(EndPoint::new(common, ReadOp::new())); let consumer = Consumer(EndPoint::new(common));
Ok(Self { producer, consumer }) Ok(Self { producer, consumer })
} }
@ -387,12 +385,15 @@ impl<T> Drop for Consumer<T> {
struct EndPoint<T, R: TRights> { struct EndPoint<T, R: TRights> {
common: Arc<Common<T>>, common: Arc<Common<T>>,
rights: R, _rights: R,
} }
impl<T, R: TRights> EndPoint<T, R> { impl<T, R: TRights> EndPoint<T, R> {
pub fn new(common: Arc<Common<T>>, rights: R) -> Self { pub fn new(common: Arc<Common<T>>) -> Self {
Self { common, rights } Self {
common,
_rights: R::new(),
}
} }
} }