Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdu1234 committed Nov 30, 2023
1 parent 2398f6b commit 8aaef26
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ fn main() {
let stream = hyper_util::rt::TokioIo::new(stream);

// Hyper has also its own `Service` trait and doesn't use tower. We can use
// `hyper::service::service_fn` to create a hyper `Service` that calls our app through
// `tower::Service::call`.
// `hyper::service::service_fn` to create a hyper `Service` that calls our app
// through `tower::Service::call`.
let hyper_service = hyper::service::service_fn(move |request: Request<Incoming>| {
// We have to clone `tower_service` because hyper's `Service` uses `&self` whereas
// tower's `Service` requires `&mut self`.
// We have to clone `tower_service` because hyper's `Service` uses `&self`
// whereas tower's `Service` requires `&mut self`.
//
// We don't need to call `poll_ready` since `Router` is always ready.
tower_service.clone().call(request)
Expand Down
2 changes: 1 addition & 1 deletion db/src/common/res.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct Res<T> {
}

/// 填入到extensions中的数据
#[derive(Debug,Clone)]
#[derive(Debug, Clone)]
pub struct ResJsonString(pub String);

#[allow(unconditional_recursion)]
Expand Down
2 changes: 1 addition & 1 deletion middleware-fn/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use app_service::service_utils::ApiUtils;
use axum::{http::StatusCode, middleware::Next, response::Response, extract::Request};
use axum::{extract::Request, http::StatusCode, middleware::Next, response::Response};
use configs::CFG;
use db::common::ctx::{ReqCtx, UserInfoCtx};

Expand Down
3 changes: 2 additions & 1 deletion middleware-fn/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ use std::{

use app_service::service_utils::api_utils::ALL_APIS;
use axum::{
extract::Request,
http::StatusCode,
middleware::Next,
response::{IntoResponse, Response}, extract::Request,
response::{IntoResponse, Response},
};
use configs::CFG;
use db::common::{
Expand Down
3 changes: 2 additions & 1 deletion middleware-fn/src/cache_skytable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use std::{collections::BTreeMap, sync::Arc, time::Instant};

use app_service::service_utils::api_utils::ALL_APIS;
use axum::{
extract::Request,
http::StatusCode,
middleware::Next,
response::{IntoResponse, Response}, extract::Request,
response::{IntoResponse, Response},
};
use configs::CFG;
use db::common::{
Expand Down
7 changes: 3 additions & 4 deletions service/src/service_utils/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ use axum::{
// headers::{authorization::Bearer, Authorization},
http::{request::Parts, StatusCode},
response::{IntoResponse, Response},
Json, RequestPartsExt,
Json,
RequestPartsExt,
};
use axum_extra::TypedHeader;
use headers::Authorization;
use headers::authorization::Bearer;

use chrono::{Duration, Local};
use db::common::ctx::UserInfoCtx;
use headers::{authorization::Bearer, Authorization};
use jsonwebtoken::{decode, encode, errors::ErrorKind, DecodingKey, EncodingKey, Header, Validation};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 8aaef26

Please sign in to comment.