Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary imports #1666

Merged
merged 1 commit into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions futures-channel/src/mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ use std::pin::Pin;
use std::sync::{Arc, Mutex};
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::SeqCst;
use std::usize;

use crate::mpsc::queue::Queue;

Expand Down Expand Up @@ -288,13 +287,13 @@ struct State {
}

// The `is_open` flag is stored in the left-most bit of `Inner::state`
const OPEN_MASK: usize = usize::MAX - (usize::MAX >> 1);
const OPEN_MASK: usize = usize::max_value() - (usize::max_value() >> 1);

// When a new channel is created, it is created in the open state with no
// pending messages.
const INIT_STATE: usize = OPEN_MASK;

// The maximum number of messages that a channel can track is `usize::MAX >> 1`
// The maximum number of messages that a channel can track is `usize::max_value() >> 1`
const MAX_CAPACITY: usize = !(OPEN_MASK);

// The maximum requested buffer size must be less than the maximum capacity of
Expand Down
1 change: 0 additions & 1 deletion futures-channel/src/mpsc/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
// slightly modified

pub(super) use self::PopResult::*;
use std::prelude::v1::*;

use std::thread;
use std::cell::UnsafeCell;
Expand Down
1 change: 0 additions & 1 deletion futures-executor/src/enter.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::prelude::v1::*;
use std::cell::Cell;
use std::fmt;

Expand Down
1 change: 0 additions & 1 deletion futures-executor/src/local_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use futures_util::stream::StreamExt;
use pin_utils::pin_mut;
use std::cell::{RefCell};
use std::ops::{Deref, DerefMut};
use std::prelude::v1::*;
use std::rc::{Rc, Weak};
use std::sync::Arc;
use std::thread::{self, Thread};
Expand Down
2 changes: 0 additions & 2 deletions futures-executor/src/thread_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ use futures_core::future::{Future, FutureObj};
use futures_core::task::{Context, Poll, Spawn, SpawnError};
use futures_util::future::FutureExt;
use futures_util::task::{ArcWake, waker_ref};
use num_cpus;
use std::io;
use std::prelude::v1::*;
use std::sync::{Arc, Mutex};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc;
Expand Down
1 change: 0 additions & 1 deletion futures-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#[cfg(feature = "std")]
mod if_std {
use futures_core::task::{Context, Poll};
use std::boxed::Box;
use std::cmp;
use std::io as StdIo;
use std::ops::DerefMut;
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/io/read/interleave_pending.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use futures_io::{self as io, AsyncBufRead, AsyncRead};
use pin_utils::{unsafe_pinned, unsafe_unpinned};
use std::{
marker::Unpin,
pin::Pin,
task::{Context, Poll},
};
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/io/write/interleave_pending_write.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use futures_io::{self as io, AsyncWrite};
use pin_utils::{unsafe_pinned, unsafe_unpinned};
use std::{
marker::Unpin,
pin::Pin,
task::{Context, Poll},
};
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/io/write/limited_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use futures_io::{self as io, AsyncWrite};
use pin_utils::{unsafe_pinned, unsafe_unpinned};
use std::{
cmp,
marker::Unpin,
pin::Pin,
task::{Context, Poll},
};
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/stream/interleave_pending.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use futures_core::stream::Stream;
use pin_utils::{unsafe_pinned, unsafe_unpinned};
use std::{
marker::Unpin,
pin::Pin,
task::{Context, Poll},
};
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/future/catch_unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use pin_utils::unsafe_pinned;
use std::any::Any;
use std::pin::Pin;
use std::panic::{catch_unwind, UnwindSafe, AssertUnwindSafe};
use std::prelude::v1::*;

/// Future for the [`catch_unwind`](super::FutureExt::catch_unwind) method.
#[derive(Debug)]
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/io/copy_into.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use futures_core::future::Future;
use futures_core::task::{Context, Poll};
use futures_io::{AsyncRead, AsyncWrite};
use std::boxed::Box;
use std::io;
use std::pin::Pin;

Expand Down
4 changes: 2 additions & 2 deletions futures-util/src/lock/mutex.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use futures_core::future::{FusedFuture, Future};
use futures_core::task::{Context, Poll, Waker};
use slab::Slab;
use std::{fmt, mem, usize};
use std::{fmt, mem};
use std::cell::UnsafeCell;
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
Expand Down Expand Up @@ -113,7 +113,7 @@ impl<T> Mutex<T> {
}

// Sentinel for when no slot in the `Slab` has been dedicated to this object.
const WAIT_KEY_NONE: usize = usize::MAX;
const WAIT_KEY_NONE: usize = usize::max_value();

/// A future which resolves when the target mutex has been successfully acquired.
pub struct MutexLockFuture<'a, T> {
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/stream/catch_unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use pin_utils::{unsafe_pinned, unsafe_unpinned};
use std::any::Any;
use std::pin::Pin;
use std::panic::{catch_unwind, UnwindSafe, AssertUnwindSafe};
use std::prelude::v1::*;

/// Stream for the [`catch_unwind`](super::StreamExt::catch_unwind) method.
#[derive(Debug)]
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/stream/concat.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use core::fmt::{Debug, Formatter, Result as FmtResult};
use core::pin::Pin;
use core::default::Default;
use futures_core::future::Future;
use futures_core::stream::Stream;
use futures_core::task::{Context, Poll};
Expand Down
2 changes: 1 addition & 1 deletion futures-util/src/stream/futures_ordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use futures_core::future::Future;
use futures_core::stream::Stream;
use futures_core::task::{Context, Poll};
use pin_utils::unsafe_pinned;
use core::cmp::{Eq, PartialEq, PartialOrd, Ord, Ordering};
use core::cmp::Ordering;
use core::fmt::{self, Debug};
use core::iter::FromIterator;
use core::pin::Pin;
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/stream/futures_unordered/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use core::pin::Pin;
use core::ptr;
use core::sync::atomic::Ordering::SeqCst;
use core::sync::atomic::{AtomicPtr, AtomicBool};
use core::usize;
use alloc::sync::{Arc, Weak};

mod abort;
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/try_stream/try_concat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::default::Default;
use core::pin::Pin;
use futures_core::future::Future;
use futures_core::stream::TryStream;
Expand Down
3 changes: 0 additions & 3 deletions futures/tests/stream.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#![feature(async_await)]

extern crate futures;
extern crate futures_util;

use futures::executor::block_on;
use futures::stream;
use futures_util::StreamExt;
Expand Down