Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sffc committed Dec 15, 2023
1 parent 0eb4966 commit 6cd01d2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions provider/core/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ pub struct DataResponseMetadata {
pub struct DataPayload<M: DataMarker>(pub(crate) DataPayloadInner<M>);

pub(crate) enum DataPayloadInner<M: DataMarker> {
Yoke(Yoke<M::Yokeable, CartableOptionPointer<SelectedRc<Box<[u8]>>>>),
Yoke(Yoke<M::Yokeable, CartableOptionPointer<CartInner>>),
StaticRef(&'static M::Yokeable),
}

/// The type of the "cart" that is used by `DataPayload`.
#[derive(Clone, Debug)]
#[allow(clippy::redundant_allocation)] // false positive, it's cheaper to wrap an existing Box in an Rc than to reallocate a huge Rc
pub struct Cart(SelectedRc<Box<[u8]>>);
pub struct Cart(CartInner);

/// The actual cart type (private typedef).
pub(crate) type CartInner = SelectedRc<Box<[u8]>>;

impl Deref for Cart {
type Target = Box<[u8]>;
Expand Down Expand Up @@ -111,7 +114,7 @@ impl Cart {
#[inline]
pub(crate) fn unwrap_yoke<Y>(
yoke: Yoke<Y, Option<Cart>>,
) -> Yoke<Y, Option<SelectedRc<Box<[u8]>>>>
) -> Yoke<Y, Option<CartInner>>
where
for<'a> Y: Yokeable<'a>,
{
Expand Down

0 comments on commit 6cd01d2

Please sign in to comment.