chore: apply rustfmt to all crates (#917)

This commit is contained in:
Carl Lerche
2019-02-21 11:56:15 -08:00
committed by GitHub
parent ab595d0825
commit 80162306e7
253 changed files with 3710 additions and 3407 deletions
+6 -8
View File
@@ -1,7 +1,7 @@
use super::chan;
use loom::sync::atomic::AtomicUsize;
use futures::{Poll, Sink, StartSend, Stream};
use loom::sync::atomic::AtomicUsize;
use std::fmt;
@@ -15,7 +15,9 @@ pub struct UnboundedSender<T> {
impl<T> Clone for UnboundedSender<T> {
fn clone(&self) -> Self {
UnboundedSender { chan: self.chan.clone() }
UnboundedSender {
chan: self.chan.clone(),
}
}
}
@@ -97,21 +99,17 @@ impl<T> Stream for UnboundedReceiver<T> {
type Error = UnboundedRecvError;
fn poll(&mut self) -> Poll<Option<T>, Self::Error> {
self.chan.recv()
.map_err(|_| UnboundedRecvError(()))
self.chan.recv().map_err(|_| UnboundedRecvError(()))
}
}
impl<T> UnboundedSender<T> {
pub(crate) fn new(chan: chan::Tx<T, Semaphore>) -> UnboundedSender<T> {
UnboundedSender { chan }
}
/// Attempts to send a message on this `UnboundedSender` without blocking.
pub fn try_send(&mut self, message: T)
-> Result<(), UnboundedTrySendError<T>>
{
pub fn try_send(&mut self, message: T) -> Result<(), UnboundedTrySendError<T>> {
self.chan.try_send(message)?;
Ok(())
}