Use nightly clippy & rustfmt for more style checks (#487)

This commit is contained in:
Jonas Platte
2021-11-09 11:53:57 +00:00
committed by GitHub
parent bcd18a03bc
commit 9c77ee0295
32 changed files with 69 additions and 65 deletions
+10 -4
View File
@@ -1,9 +1,15 @@
mod starwars;
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
use async_graphql::{EmptyMutation, EmptySubscription, Request, Response, Schema};
use axum::response::IntoResponse;
use axum::{extract::Extension, response::Html, routing::get, AddExtensionLayer, Json, Router};
use async_graphql::{
http::{playground_source, GraphQLPlaygroundConfig},
EmptyMutation, EmptySubscription, Request, Response, Schema,
};
use axum::{
extract::Extension,
response::{Html, IntoResponse},
routing::get,
AddExtensionLayer, Json, Router,
};
use starwars::{QueryRoot, StarWars, StarWarsSchema};
async fn graphql_handler(schema: Extension<StarWarsSchema>, req: Json<Request>) -> Json<Response> {
+4 -2
View File
@@ -1,6 +1,8 @@
use super::StarWars;
use async_graphql::connection::{query, Connection, Edge, EmptyFields};
use async_graphql::{Context, Enum, FieldResult, Interface, Object};
use async_graphql::{
connection::{query, Connection, Edge, EmptyFields},
Context, Enum, FieldResult, Interface, Object,
};
/// One of the films in the Star Wars Trilogy
#[derive(Enum, Copy, Clone, Eq, PartialEq)]
@@ -6,8 +6,7 @@
use axum::{
async_trait,
extract::rejection::JsonRejection,
extract::{FromRequest, RequestParts},
extract::{rejection::JsonRejection, FromRequest, RequestParts},
http::StatusCode,
routing::post,
BoxError, Router,
+1
View File
@@ -148,6 +148,7 @@ async fn logout(
}
#[derive(Debug, Deserialize)]
#[allow(dead_code)]
struct AuthRequest {
code: String,
state: String,
@@ -31,6 +31,7 @@ async fn handler(Query(params): Query<Params>) -> String {
///
/// [`serde_with`]: https://docs.rs/serde_with/1.11.0/serde_with/rust/string_empty_as_none/index.html
#[derive(Debug, Deserialize)]
#[allow(dead_code)]
struct Params {
#[serde(default, deserialize_with = "empty_string_as_none")]
foo: Option<String>,
+4 -2
View File
@@ -47,8 +47,10 @@ fn app() -> Router {
#[cfg(test)]
mod tests {
use super::*;
use axum::body::Body;
use axum::http::{self, Request, StatusCode};
use axum::{
body::Body,
http::{self, Request, StatusCode},
};
use serde_json::{json, Value};
use std::net::{SocketAddr, TcpListener};
use tower::ServiceExt; // for `app.oneshot()`
+2 -2
View File
@@ -23,10 +23,9 @@ use std::{
sync::Arc,
task::{Context, Poll},
};
use tokio::net::{unix::UCred, UnixListener};
use tokio::{
io::{AsyncRead, AsyncWrite},
net::UnixStream,
net::{unix::UCred, UnixListener, UnixStream},
};
use tower::BoxError;
@@ -150,6 +149,7 @@ impl Connection for ClientConnection {
}
#[derive(Clone, Debug)]
#[allow(dead_code)]
struct UdsConnectInfo {
peer_addr: Arc<tokio::net::unix::SocketAddr>,
peer_cred: UCred,
+1 -2
View File
@@ -13,8 +13,7 @@ use axum::{
routing::get,
Router,
};
use std::collections::HashMap;
use std::net::SocketAddr;
use std::{collections::HashMap, net::SocketAddr};
#[tokio::main]
async fn main() {