From 68287c071e956ecdb97c751f517614b69fb80a41 Mon Sep 17 00:00:00 2001 From: yjhmelody <465402634@qq.com> Date: Fri, 1 Nov 2019 14:21:28 +0800 Subject: [PATCH] replace u64 with usize --- futures-util/src/stream/stream/mod.rs | 4 ++-- futures-util/src/stream/stream/skip.rs | 6 +++--- futures-util/src/stream/stream/take.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/futures-util/src/stream/stream/mod.rs b/futures-util/src/stream/stream/mod.rs index 03174830c7..b6538ac289 100644 --- a/futures-util/src/stream/stream/mod.rs +++ b/futures-util/src/stream/stream/mod.rs @@ -719,7 +719,7 @@ pub trait StreamExt: Stream { /// assert_eq!(vec![1, 2, 3], stream.collect::>().await); /// # }); /// ``` - fn take(self, n: u64) -> Take + fn take(self, n: usize) -> Take where Self: Sized, { @@ -742,7 +742,7 @@ pub trait StreamExt: Stream { /// assert_eq!(vec![6, 7, 8, 9, 10], stream.collect::>().await); /// # }); /// ``` - fn skip(self, n: u64) -> Skip + fn skip(self, n: usize) -> Skip where Self: Sized, { diff --git a/futures-util/src/stream/stream/skip.rs b/futures-util/src/stream/stream/skip.rs index f9edf2ae9e..0b7c632daf 100644 --- a/futures-util/src/stream/stream/skip.rs +++ b/futures-util/src/stream/stream/skip.rs @@ -10,16 +10,16 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned}; #[must_use = "streams do nothing unless polled"] pub struct Skip { stream: St, - remaining: u64, + remaining: usize, } impl Unpin for Skip {} impl Skip { unsafe_pinned!(stream: St); - unsafe_unpinned!(remaining: u64); + unsafe_unpinned!(remaining: usize); - pub(super) fn new(stream: St, n: u64) -> Skip { + pub(super) fn new(stream: St, n: usize) -> Skip { Skip { stream, remaining: n, diff --git a/futures-util/src/stream/stream/take.rs b/futures-util/src/stream/stream/take.rs index 4d0dbd31d2..1109a4a0f0 100644 --- a/futures-util/src/stream/stream/take.rs +++ b/futures-util/src/stream/stream/take.rs @@ -11,16 +11,16 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned}; #[must_use = "streams do nothing unless polled"] pub struct Take { stream: St, - remaining: u64, + remaining: usize, } impl Unpin for Take {} impl Take { unsafe_pinned!(stream: St); - unsafe_unpinned!(remaining: u64); + unsafe_unpinned!(remaining: usize); - pub(super) fn new(stream: St, n: u64) -> Take { + pub(super) fn new(stream: St, n: usize) -> Take { Take { stream, remaining: n,