diff --git a/examples/load_balancing_broker.rs b/examples/load_balancing_broker.rs index 1cb2dcc..d718d57 100644 --- a/examples/load_balancing_broker.rs +++ b/examples/load_balancing_broker.rs @@ -191,7 +191,11 @@ fn worker_task(worker_num: usize) -> usize { .and_then(|multipart| { let mut envelope: Envelope = multipart.try_into()?; - println!("Worker: {:?} from {:?}", envelope.request().as_str(), envelope.addr().as_str()); + println!( + "Worker: {:?} from {:?}", + envelope.request().as_str(), + envelope.addr().as_str() + ); let msg = zmq::Message::from_slice(b"OK")?; envelope.set_request(msg); @@ -327,8 +331,7 @@ fn main() { let mut broker_thread = None; match use_broker { - UseBroker::Yes | - UseBroker::All => { + UseBroker::Yes | UseBroker::All => { // Spawn threads broker_thread = Some(thread::spawn(broker_task)); } @@ -336,8 +339,7 @@ fn main() { } match use_broker { - UseBroker::No | - UseBroker::All => { + UseBroker::No | UseBroker::All => { // Set up control socket let mut core = Core::new().unwrap(); let context = Rc::new(zmq::Context::new()); diff --git a/tokio-zmq-derive/src/lib.rs b/tokio-zmq-derive/src/lib.rs index 35f1262..8793873 100644 --- a/tokio-zmq-derive/src/lib.rs +++ b/tokio-zmq-derive/src/lib.rs @@ -1,10 +1,10 @@ extern crate proc_macro; extern crate syn; -#[macro_use] -extern crate synstructure; #[macro_use] extern crate quote; +#[macro_use] +extern crate synstructure; decl_derive!([SocketWrapper, attributes(stream, sink, controlled, try_from)] => socket_derive); decl_derive!([ControlledSocketWrapper, attributes(sink)] => controlled_socket_derive); @@ -26,14 +26,14 @@ fn socket_derive(s: synstructure::Structure) -> quote::Tokens { let as_socket = s.bound_impl( "::prelude::AsSocket", quote! { - fn socket(&self) -> &Socket { - &self.inner - } + fn socket(&self) -> &Socket { + &self.inner + } - fn into_socket(self) -> Socket { - self.inner - } - }, + fn into_socket(self) -> Socket { + self.inner + } + }, ); let name = sb.ast().ident; @@ -122,17 +122,17 @@ fn into_controlled(s: &synstructure::Structure) -> quote::Tokens { s.bound_impl( "::prelude::IntoControlledSocket", quote! { - type Controlled = #control; - - fn controlled(self, control: S) -> Self::Controlled - where - S: ::prelude::StreamSocket, - { - #control { - inner: self.inner.controlled(control) + type Controlled = #control; + + fn controlled(self, control: S) -> Self::Controlled + where + S: ::prelude::StreamSocket, + { + #control { + inner: self.inner.controlled(control) + } } - } - }, + }, ) } else { quote!{} @@ -156,10 +156,10 @@ fn controlled_socket_derive(s: synstructure::Structure) -> quote::Tokens { let as_socket = s.bound_impl( "::prelude::AsControlledSocket", quote! { - fn socket(&self) -> &ControlledSocket { - &self.inner - } - }, + fn socket(&self) -> &ControlledSocket { + &self.inner + } + }, ); let stream = s.bound_impl("::prelude::ControlledStreamSocket", quote!{});