From 70ffab8368a0ded4b18716dd01b69cbf483eec40 Mon Sep 17 00:00:00 2001 From: anthonyjchriste Date: Mon, 24 Jun 2019 09:16:06 -1000 Subject: [PATCH] Fix formatting. --- actix-web-actors/src/ws.rs | 72 +++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/actix-web-actors/src/ws.rs b/actix-web-actors/src/ws.rs index 430f2009..e48d1995 100644 --- a/actix-web-actors/src/ws.rs +++ b/actix-web-actors/src/ws.rs @@ -27,9 +27,9 @@ use futures::{Async, Future, Poll, Stream}; /// Do websocket handshake and start ws actor. pub fn start(actor: A, req: &HttpRequest, stream: T) -> Result - where - A: Actor> + StreamHandler, - T: Stream + 'static, +where + A: Actor> + StreamHandler, + T: Stream + 'static, { let mut res = handshake(req)?; Ok(res.streaming(WebsocketContext::create(actor, stream))) @@ -101,16 +101,16 @@ pub fn handshake(req: &HttpRequest) -> Result - where - A: Actor>, +where + A: Actor>, { inner: ContextParts, messages: VecDeque>, } impl ActorContext for WebsocketContext - where - A: Actor, +where + A: Actor, { fn stop(&mut self) { self.inner.stop(); @@ -126,8 +126,8 @@ impl ActorContext for WebsocketContext } impl AsyncContext for WebsocketContext - where - A: Actor, +where + A: Actor, { fn spawn(&mut self, fut: F) -> SpawnHandle where @@ -137,8 +137,8 @@ impl AsyncContext for WebsocketContext } fn wait(&mut self, fut: F) - where - F: ActorFuture + 'static, + where + F: ActorFuture + 'static, { self.inner.wait(fut) } @@ -162,15 +162,15 @@ impl AsyncContext for WebsocketContext } impl WebsocketContext - where - A: Actor, +where + A: Actor, { #[inline] /// Create a new Websocket context from a request and an actor pub fn create(actor: A, stream: S) -> impl Stream - where - A: StreamHandler, - S: Stream + 'static, + where + A: StreamHandler, + S: Stream + 'static, { let mb = Mailbox::default(); let mut ctx = WebsocketContext { @@ -204,10 +204,10 @@ impl WebsocketContext stream: S, f: F, ) -> impl Stream - where - F: FnOnce(&mut Self) -> A + 'static, - A: StreamHandler, - S: Stream + 'static, + where + F: FnOnce(&mut Self) -> A + 'static, + A: StreamHandler, + S: Stream + 'static, { let mb = Mailbox::default(); let mut ctx = WebsocketContext { @@ -223,8 +223,8 @@ impl WebsocketContext } impl WebsocketContext - where - A: Actor, +where + A: Actor, { /// Write payload /// @@ -283,8 +283,8 @@ impl WebsocketContext } impl AsyncContextParts for WebsocketContext - where - A: Actor, +where + A: Actor, { fn parts(&mut self) -> &mut ContextParts { &mut self.inner @@ -302,8 +302,8 @@ struct WebsocketContextFut } impl WebsocketContextFut - where - A: Actor>, +where + A: Actor>, { fn new(ctx: WebsocketContext, act: A, mailbox: Mailbox, codec: Codec) -> Self { let fut = ContextFut::new(ctx, act, mailbox); @@ -317,8 +317,8 @@ impl WebsocketContextFut } impl Stream for WebsocketContextFut - where - A: Actor>, +where + A: Actor>, { type Item = Bytes; type Error = Error; @@ -349,10 +349,10 @@ impl Stream for WebsocketContextFut } impl ToEnvelope for WebsocketContext - where - A: Actor> + Handler, - M: ActixMessage + Send + 'static, - M::Result: Send, +where + A: Actor> + Handler, + M: ActixMessage + Send + 'static, + M::Result: Send, { fn pack(msg: M, tx: Option>) -> Envelope { Envelope::new(msg, tx) @@ -367,8 +367,8 @@ struct WsStream { } impl WsStream - where - S: Stream, +where + S: Stream, { fn new(stream: S, codec: Codec) -> Self { Self { @@ -381,8 +381,8 @@ impl WsStream } impl Stream for WsStream - where - S: Stream, +where + S: Stream, { type Item = Message; type Error = ProtocolError;