Skip to content

Commit

Permalink
replace u64 with usize
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhmelody authored and cramertj committed Nov 1, 2019
1 parent c429188 commit 25d638d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions futures-util/src/stream/stream/mod.rs
Expand Up @@ -719,7 +719,7 @@ pub trait StreamExt: Stream {
/// assert_eq!(vec![1, 2, 3], stream.collect::<Vec<_>>().await);
/// # });
/// ```
fn take(self, n: u64) -> Take<Self>
fn take(self, n: usize) -> Take<Self>
where
Self: Sized,
{
Expand All @@ -742,7 +742,7 @@ pub trait StreamExt: Stream {
/// assert_eq!(vec![6, 7, 8, 9, 10], stream.collect::<Vec<_>>().await);
/// # });
/// ```
fn skip(self, n: u64) -> Skip<Self>
fn skip(self, n: usize) -> Skip<Self>
where
Self: Sized,
{
Expand Down
6 changes: 3 additions & 3 deletions futures-util/src/stream/stream/skip.rs
Expand Up @@ -10,16 +10,16 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
#[must_use = "streams do nothing unless polled"]
pub struct Skip<St> {
stream: St,
remaining: u64,
remaining: usize,
}

impl<St: Unpin> Unpin for Skip<St> {}

impl<St: Stream> Skip<St> {
unsafe_pinned!(stream: St);
unsafe_unpinned!(remaining: u64);
unsafe_unpinned!(remaining: usize);

pub(super) fn new(stream: St, n: u64) -> Skip<St> {
pub(super) fn new(stream: St, n: usize) -> Skip<St> {
Skip {
stream,
remaining: n,
Expand Down
6 changes: 3 additions & 3 deletions futures-util/src/stream/stream/take.rs
Expand Up @@ -11,16 +11,16 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
#[must_use = "streams do nothing unless polled"]
pub struct Take<St> {
stream: St,
remaining: u64,
remaining: usize,
}

impl<St: Unpin> Unpin for Take<St> {}

impl<St: Stream> Take<St> {
unsafe_pinned!(stream: St);
unsafe_unpinned!(remaining: u64);
unsafe_unpinned!(remaining: usize);

pub(super) fn new(stream: St, n: u64) -> Take<St> {
pub(super) fn new(stream: St, n: usize) -> Take<St> {
Take {
stream,
remaining: n,
Expand Down

0 comments on commit 25d638d

Please sign in to comment.