From 0f76de10d6ed2dd7b1668ab70f7d613f8969f632 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Wed, 20 Mar 2024 13:11:06 +0100 Subject: [PATCH] rustfmt --- bindings/src/lib.rs | 4 ++-- macros/src/lib.rs | 3 +-- rust-example/src/lib.rs | 7 ++++++- shared/src/lib.rs | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/bindings/src/lib.rs b/bindings/src/lib.rs index d26a0aa..93f69e0 100644 --- a/bindings/src/lib.rs +++ b/bindings/src/lib.rs @@ -1,10 +1,10 @@ use std::{cell::RefCell, collections::HashMap}; pub use crows_macros::config; -use serde::{Serialize, Deserialize, de::DeserializeOwned}; -use serde_json::{to_vec, from_slice}; pub use crows_shared::Config as ExecutorConfig; pub use crows_shared::ConstantArrivalRateConfig; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde_json::{from_slice, to_vec}; #[derive(Serialize, Deserialize, PartialEq, Debug)] pub enum HTTPMethod { diff --git a/macros/src/lib.rs b/macros/src/lib.rs index d99e8ef..dc22f8c 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -7,7 +7,7 @@ use syn::{parse_macro_input, ItemFn}; #[proc_macro_attribute] pub fn config(_: TokenStream, input: TokenStream) -> TokenStream { let input_fn = parse_macro_input!(input as ItemFn); - + let fn_name = &input_fn.sig.ident; let generated_fn_name = syn::Ident::new(&format!("__{}", fn_name), fn_name.span()); let _ = &input_fn.vis; @@ -23,4 +23,3 @@ pub fn config(_: TokenStream, input: TokenStream) -> TokenStream { TokenStream::from(expanded) } - diff --git a/rust-example/src/lib.rs b/rust-example/src/lib.rs index 3b512a0..29b11d4 100644 --- a/rust-example/src/lib.rs +++ b/rust-example/src/lib.rs @@ -19,6 +19,11 @@ fn config() -> ExecutorConfig { #[export_name = "test"] pub fn test() { - let response = http_request("http://127.0.0.1:8080/".into(), GET, HashMap::new(), "".into()); + let response = http_request( + "http://127.0.0.1:8080/".into(), + GET, + HashMap::new(), + "".into(), + ); // println!("response: {:?}", response.unwrap().status); } diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 911f1ab..2d48543 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -1,6 +1,6 @@ use std::time::Duration; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; pub trait ExecutorConfig { fn split(&self, times: usize) -> Config; @@ -14,7 +14,7 @@ pub enum Config { impl Config { pub fn split(&self, times: usize) -> Config { match self { - Config::ConstantArrivalRate(config) => config.split(times) + Config::ConstantArrivalRate(config) => config.split(times), } } }