Skip to content

Commit

Permalink
Remove unnecessary imports
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed Jun 10, 2019
1 parent 83768aa commit 93223f5
Show file tree
Hide file tree
Showing 19 changed files with 5 additions and 25 deletions.
5 changes: 2 additions & 3 deletions futures-channel/src/mpsc/mod.rs
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
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
@@ -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
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
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
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
@@ -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
@@ -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
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
@@ -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
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
@@ -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
@@ -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
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
@@ -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
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
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
@@ -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
@@ -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

0 comments on commit 93223f5

Please sign in to comment.