Format code
This commit is contained in:
parent
7480353a10
commit
48dbf38211
|
@ -1,5 +1,5 @@
|
||||||
use criterion::{criterion_group, criterion_main, Criterion, black_box};
|
use criterion::{black_box, criterion_group, criterion_main, Criterion};
|
||||||
use simple::{Q, run, parse, serialize, GQLResponse};
|
use simple::{parse, run, serialize, GQLResponse, Q};
|
||||||
|
|
||||||
pub fn criterion_benchmark(c: &mut Criterion) {
|
pub fn criterion_benchmark(c: &mut Criterion) {
|
||||||
c.bench_function("run", |b| b.iter(|| run(black_box(Q))));
|
c.bench_function("run", |b| b.iter(|| run(black_box(Q))));
|
||||||
|
@ -9,4 +9,4 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
criterion_group!(benches, criterion_benchmark);
|
criterion_group!(benches, criterion_benchmark);
|
||||||
criterion_main!(benches);
|
criterion_main!(benches);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use async_graphql::*;
|
use async_graphql::*;
|
||||||
pub use http::GQLResponse;
|
|
||||||
use async_graphql_parser::{parse_query, query::Document};
|
use async_graphql_parser::{parse_query, query::Document};
|
||||||
use async_std::task;
|
use async_std::task;
|
||||||
|
pub use http::GQLResponse;
|
||||||
|
|
||||||
pub struct QueryRoot;
|
pub struct QueryRoot;
|
||||||
|
|
||||||
|
@ -78,9 +78,7 @@ lazy_static::lazy_static! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn run(q: &str) -> Result<QueryResponse> {
|
pub fn run(q: &str) -> Result<QueryResponse> {
|
||||||
task::block_on(async {
|
task::block_on(async { S.execute(q).await })
|
||||||
S.execute(q).await
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse(q: &str) -> Document {
|
pub fn parse(q: &str) -> Document {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user