chore: cargo fmt

This commit is contained in:
alyssa 2024-11-01 06:42:21 +09:00
parent c8b6dc4c23
commit 299be27031
4 changed files with 8 additions and 5 deletions

View file

@ -6,7 +6,7 @@ use axum::{
middleware::{FromFnLayer, Next}, middleware::{FromFnLayer, Next},
response::Response, response::Response,
}; };
use fred::{clients::RedisPool, prelude::LuaInterface, util::sha1_hash, interfaces::ClientLike}; use fred::{clients::RedisPool, interfaces::ClientLike, prelude::LuaInterface, util::sha1_hash};
use metrics::counter; use metrics::counter;
use tracing::{debug, error, info, warn}; use tracing::{debug, error, info, warn};
@ -45,7 +45,10 @@ pub fn ratelimiter<F, T>(f: F) -> FromFnLayer<F, Option<RedisPool>, T> {
let rscript = r.clone(); let rscript = r.clone();
tokio::spawn(async move { tokio::spawn(async move {
if let Ok(()) = rscript.wait_for_connect().await { if let Ok(()) = rscript.wait_for_connect().await {
match rscript.script_load::<String, String>(LUA_SCRIPT.to_string()).await { match rscript
.script_load::<String, String>(LUA_SCRIPT.to_string())
.await
{
Ok(_) => info!("connected to redis for request rate limiting"), Ok(_) => info!("connected to redis for request rate limiting"),
Err(err) => error!("could not load redis script: {}", err), Err(err) => error!("could not load redis script: {}", err),
} }

View file

@ -1,7 +1,7 @@
use fred::{ use fred::{
clients::RedisPool,
error::RedisError, error::RedisError,
interfaces::KeysInterface, interfaces::KeysInterface,
clients::RedisPool,
types::{Expiration, SetOptions}, types::{Expiration, SetOptions},
}; };
use std::fmt::Debug; use std::fmt::Debug;

View file

@ -1,5 +1,5 @@
use bytes::Bytes; use bytes::Bytes;
use fred::{interfaces::HashesInterface, clients::RedisPool}; use fred::{clients::RedisPool, interfaces::HashesInterface};
use prost::Message; use prost::Message;
use tracing::info; use tracing::info;
use twilight_gateway::Event; use twilight_gateway::Event;

View file

@ -1,5 +1,5 @@
use chrono::Timelike; use chrono::Timelike;
use fred::{interfaces::*, clients::RedisPool}; use fred::{clients::RedisPool, interfaces::*};
use signal_hook::{ use signal_hook::{
consts::{SIGINT, SIGTERM}, consts::{SIGINT, SIGTERM},
iterator::Signals, iterator::Signals,