Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
chevdor committed Apr 19, 2021
1 parent a6f7574 commit 2b33a12
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion derive/src/rpc_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ impl RpcMethodAttribute {
let returns = get_meta_list(meta).and_then(|ml| get_name_value(RETURNS_META_WORD, ml));
let is_notification = match output {
syn::ReturnType::Default => true,
syn::ReturnType::Type(_, ret) => matches!(**ret, syn::Type::Tuple(ref tup) if tup.elems.empty_or_trailing()),
syn::ReturnType::Type(_, ret) => {
matches!(**ret, syn::Type::Tuple(ref tup) if tup.elems.empty_or_trailing())
}
};

if is_notification && returns.is_some() {
Expand Down
7 changes: 6 additions & 1 deletion derive/src/to_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ fn generate_client_methods(methods: &[MethodRegistration], options: &DeriveOptio
};
let returns_str = quote!(#returns).to_string();

let args_serialized = match method.attr.params_style.clone().unwrap_or_else(|| options.params_style.clone()) {
let args_serialized = match method
.attr
.params_style
.clone()
.unwrap_or_else(|| options.params_style.clone())
{
ParamStyle::Named => {
quote! { // use object style serialization with field names taken from the function param names
serde_json::json!({
Expand Down
2 changes: 1 addition & 1 deletion server-utils/src/cors.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! CORS handling utility functions
pub use unicase::Ascii;
use crate::hosts::{Host, Port};
use crate::matcher::{Matcher, Pattern};
use std::collections::HashSet;
use std::{fmt, ops};
pub use unicase::Ascii;

/// Origin Protocol
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
Expand Down
2 changes: 1 addition & 1 deletion tcp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ where
match start.await {
Ok(server) => {
tx.send(Ok(())).expect("Rx is blocking parent thread.");
let server = server.buffer_unordered(1024).for_each(|_| async { });
let server = server.buffer_unordered(1024).for_each(|_| async {});

future::select(Box::pin(server), stop_rx).await;
}
Expand Down

0 comments on commit 2b33a12

Please sign in to comment.