Skip to content

Commit

Permalink
Rename GroupInner to InnerGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus-consoli committed Mar 22, 2024
1 parent 9505c43 commit 8753dde
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::utils::{PollVec, WakerVec};
const GROUP_GROWTH_FACTOR: usize = 2;

#[pin_project::pin_project]
pub struct GroupInner<A> {
pub struct InnerGroup<A> {
#[pin]
pub items: Slab<A>,
pub wakers: WakerVec,
Expand All @@ -18,7 +18,7 @@ pub struct GroupInner<A> {
len: usize,
}

impl<A> GroupInner<A> {
impl<A> InnerGroup<A> {
pub fn with_capacity(cap: usize) -> Self {
Self {
items: Slab::with_capacity(cap),
Expand Down Expand Up @@ -117,20 +117,20 @@ impl<A> GroupInner<A> {
}

/// Keyed operations
impl<A> GroupInner<A> {
impl<A> InnerGroup<A> {
// move to other impl block
pub fn contains_key(&self, key: Key) -> bool {
self.items.contains(key.0)
}
}

impl<A> Default for GroupInner<A> {
impl<A> Default for InnerGroup<A> {
fn default() -> Self {
Self::with_capacity(0)
}
}

impl<A> fmt::Debug for GroupInner<A> {
impl<A> fmt::Debug for InnerGroup<A> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("GroupInner")
.field("cap", &self.cap)
Expand Down
2 changes: 1 addition & 1 deletion src/collections/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub(crate) mod group_inner;
pub(crate) mod inner_group;
#[cfg(feature = "alloc")]
pub mod vec;
6 changes: 3 additions & 3 deletions src/future/future_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use core::task::{Context, Poll};
use futures_core::stream::Stream;
use futures_core::Future;

use crate::collections::group_inner::{GroupInner, Key};
use crate::collections::inner_group::{InnerGroup, Key};

/// A growable group of futures which act as a single unit.
///
Expand Down Expand Up @@ -59,7 +59,7 @@ use crate::collections::group_inner::{GroupInner, Key};
#[pin_project::pin_project]
pub struct FutureGroup<F> {
#[pin]
inner: GroupInner<F>,
inner: InnerGroup<F>,
}

impl<F> FutureGroup<F> {
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<F> FutureGroup<F> {
/// ```
pub fn with_capacity(capacity: usize) -> Self {
Self {
inner: GroupInner::with_capacity(capacity),
inner: InnerGroup::with_capacity(capacity),
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/stream/stream_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::task::{Context, Poll};
use futures_core::Stream;
use smallvec::{smallvec, SmallVec};

use crate::collections::group_inner::{GroupInner, Key};
use crate::collections::inner_group::{InnerGroup, Key};

/// A growable group of streams which act as a single unit.
///
Expand Down Expand Up @@ -59,7 +59,7 @@ use crate::collections::group_inner::{GroupInner, Key};
#[pin_project::pin_project]
pub struct StreamGroup<S> {
#[pin]
inner: GroupInner<S>,
inner: InnerGroup<S>,
}

impl<S> StreamGroup<S> {
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<S> StreamGroup<S> {
/// ```
pub fn with_capacity(capacity: usize) -> Self {
Self {
inner: GroupInner::with_capacity(capacity),
inner: InnerGroup::with_capacity(capacity),
}
}

Expand Down

0 comments on commit 8753dde

Please sign in to comment.