Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
drogus committed Mar 20, 2024
1 parent 77bf677 commit 0f76de1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -23,4 +23,3 @@ pub fn config(_: TokenStream, input: TokenStream) -> TokenStream {

TokenStream::from(expanded)
}

7 changes: 6 additions & 1 deletion rust-example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
4 changes: 2 additions & 2 deletions shared/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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),
}
}
}
Expand Down

0 comments on commit 0f76de1

Please sign in to comment.