Skip to content

Commit c98cc26

Browse files
committed
Rustfmt
1 parent ffb8cb9 commit c98cc26

File tree

28 files changed

+180
-115
lines changed

28 files changed

+180
-115
lines changed

.rustfmt.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
edition = "2021"
2+
newline_style = "Unix"
3+
# comments
4+
normalize_comments = true
5+
wrap_comments = true
6+
format_code_in_doc_comments = true
7+
# imports
8+
imports_granularity = "Crate"
9+
group_imports = "StdExternalCrate"
10+
# report
11+
#report_fixme="Unnumbered"
12+
#report_todo="Unnumbered"

actix-web/error-extensions/src/main.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#[macro_use]
22
extern crate thiserror;
33

4-
use actix_web::web::Data;
5-
use actix_web::{guard, web, App, HttpResponse, HttpServer};
6-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
4+
use actix_web::{guard, web, web::Data, App, HttpResponse, HttpServer};
75
use async_graphql::{
6+
http::{playground_source, GraphQLPlaygroundConfig},
87
EmptyMutation, EmptySubscription, ErrorExtensions, FieldError, FieldResult, Object, ResultExt,
98
Schema,
109
};
@@ -49,8 +48,8 @@ impl QueryRoot {
4948
.map_err(|e: std::num::ParseIntError| e.extend_with(|_, e| e.set("code", 404)))?)
5049
}
5150

52-
// THIS does unfortunately NOT work because ErrorExtensions is implemented for &E and not E.
53-
// Which is necessary for the overwrite by the user.
51+
// THIS does unfortunately NOT work because ErrorExtensions is implemented for
52+
// &E and not E. Which is necessary for the overwrite by the user.
5453

5554
// async fn parse_with_extensions_result(&self) -> FieldResult<i32> {
5655
// Ok("234a".parse().extend_err(|_| json!({"code": 404}))?)

actix-web/starwars/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use actix_web::web::Data;
2-
use actix_web::{guard, web, App, HttpResponse, HttpServer, Result};
3-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
4-
use async_graphql::{EmptyMutation, EmptySubscription, Schema};
1+
use actix_web::{guard, web, web::Data, App, HttpResponse, HttpServer, Result};
2+
use async_graphql::{
3+
http::{playground_source, GraphQLPlaygroundConfig},
4+
EmptyMutation, EmptySubscription, Schema,
5+
};
56
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse};
67
use starwars::{QueryRoot, StarWars, StarWarsSchema};
78

actix-web/subscription/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use actix_web::web::Data;
2-
use actix_web::{guard, web, App, HttpRequest, HttpResponse, HttpServer, Result};
3-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
4-
use async_graphql::Schema;
1+
use actix_web::{guard, web, web::Data, App, HttpRequest, HttpResponse, HttpServer, Result};
2+
use async_graphql::{
3+
http::{playground_source, GraphQLPlaygroundConfig},
4+
Schema,
5+
};
56
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse, GraphQLSubscription};
67
use books::{BooksSchema, MutationRoot, QueryRoot, Storage, SubscriptionRoot};
78

actix-web/token-from-header/src/main.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
use actix_web::http::header::HeaderMap;
2-
use actix_web::{guard, web, App, HttpRequest, HttpResponse, HttpServer, Result};
3-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
4-
use async_graphql::{Data, EmptyMutation, Schema};
1+
use actix_web::{
2+
guard, http::header::HeaderMap, web, App, HttpRequest, HttpResponse, HttpServer, Result,
3+
};
4+
use async_graphql::{
5+
http::{playground_source, GraphQLPlaygroundConfig},
6+
Data, EmptyMutation, Schema,
7+
};
58
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse, GraphQLSubscription};
69
use token::{on_connection_init, QueryRoot, SubscriptionRoot, Token, TokenSchema};
710

actix-web/upload/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use actix_web::web::Data;
2-
use actix_web::{guard, web, App, HttpResponse, HttpServer};
3-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig, MultipartOptions};
4-
use async_graphql::{EmptySubscription, Schema};
1+
use actix_web::{guard, web, web::Data, App, HttpResponse, HttpServer};
2+
use async_graphql::{
3+
http::{playground_source, GraphQLPlaygroundConfig, MultipartOptions},
4+
EmptySubscription, Schema,
5+
};
56
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse};
67
use files::{FilesSchema, MutationRoot, QueryRoot, Storage};
78

axum/starwars/src/main.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
2-
use async_graphql::{EmptyMutation, EmptySubscription, Schema};
1+
use async_graphql::{
2+
http::{playground_source, GraphQLPlaygroundConfig},
3+
EmptyMutation, EmptySubscription, Schema,
4+
};
35
use async_graphql_axum::{GraphQLRequest, GraphQLResponse};
4-
use axum::extract::Extension;
5-
use axum::response::{self, IntoResponse};
6-
use axum::routing::get;
7-
use axum::{Router, Server};
6+
use axum::{
7+
extract::Extension,
8+
response::{self, IntoResponse},
9+
routing::get,
10+
Router, Server,
11+
};
812
use starwars::{QueryRoot, StarWars, StarWarsSchema};
913

1014
async fn graphql_handler(

axum/subscription/src/main.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
2-
use async_graphql::Schema;
1+
use async_graphql::{
2+
http::{playground_source, GraphQLPlaygroundConfig},
3+
Schema,
4+
};
35
use async_graphql_axum::{GraphQLRequest, GraphQLResponse, GraphQLSubscription};
4-
use axum::response::{self, IntoResponse};
5-
use axum::routing::get;
6-
use axum::{extract::Extension, Router, Server};
6+
use axum::{
7+
extract::Extension,
8+
response::{self, IntoResponse},
9+
routing::get,
10+
Router, Server,
11+
};
712
use books::{BooksSchema, MutationRoot, QueryRoot, Storage, SubscriptionRoot};
813

914
async fn graphql_handler(schema: Extension<BooksSchema>, req: GraphQLRequest) -> GraphQLResponse {

axum/upload/src/main.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
2-
use async_graphql::{EmptySubscription, Schema};
1+
use async_graphql::{
2+
http::{playground_source, GraphQLPlaygroundConfig},
3+
EmptySubscription, Schema,
4+
};
35
use async_graphql_axum::{GraphQLRequest, GraphQLResponse};
4-
use axum::extract::Extension;
5-
use axum::response::{Html, IntoResponse};
6-
use axum::routing::get;
7-
use axum::Router;
6+
use axum::{
7+
extract::Extension,
8+
response::{Html, IntoResponse},
9+
routing::get,
10+
Router,
11+
};
812
use files::{FilesSchema, MutationRoot, QueryRoot, Storage};
913
use hyper::{Method, Server};
1014
use tower_http::cors::{CorsLayer, Origin};

federation/federation-accounts/src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
use std::convert::Infallible;
2+
13
use async_graphql::{EmptyMutation, EmptySubscription, Object, Schema, SimpleObject, ID};
24
use async_graphql_warp::graphql;
3-
use std::convert::Infallible;
45
use warp::{Filter, Reply};
56

67
#[derive(SimpleObject)]

0 commit comments

Comments
 (0)