Skip to content

Commit

Permalink
feat: add rustfmt config
Browse files Browse the repository at this point in the history
  • Loading branch information
uku3lig committed Dec 26, 2024
1 parent 1b7cf05 commit a78643d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
devShells.default = pkgs.mkShell {
packages = with pkgs; [
clippy
rustfmt
(rustfmt.override { asNightly = true; })
rust-analyzer

redis
Expand Down
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
3 changes: 1 addition & 2 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use std::collections::HashMap;
use anyhow::Result;
use bb8::Pool;
use bb8_redis::RedisConnectionManager;
use redis::FromRedisValue;
use redis::{AsyncCommands, Client, ConnectionLike};
use redis::{AsyncCommands, Client, ConnectionLike, FromRedisValue};
use redis_macros::ToRedisArgs;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
Expand Down
13 changes: 6 additions & 7 deletions src/discord.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use std::sync::Arc;

use axum::extract::State;
use axum::http::StatusCode;
use axum::response::Redirect;
use axum::{extract::Query, response::IntoResponse};
use axum::{
extract::{Query, State},
http::StatusCode,
response::{IntoResponse, Redirect},
};
use serde::{Deserialize, Serialize};
use serenity::all::{CreateInvite, Http};

use crate::config::EnvCfg;
use crate::AppState;
use crate::{util::IntoAppError, RouteResponse};
use crate::{config::EnvCfg, util::IntoAppError, AppState, RouteResponse};

const VERIF_URL: &str = "https://challenges.cloudflare.com/turnstile/v0/siteverify";

Expand Down
13 changes: 6 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,15 @@ mod util;

use std::sync::{Arc, LazyLock};

use axum::routing::get;
use axum::{middleware, Router};
use reqwest::header::{HeaderMap, USER_AGENT};
use reqwest::StatusCode;
use axum::{middleware, routing::get, Router};
use reqwest::{
header::{HeaderMap, USER_AGENT},
StatusCode,
};
use tokio::signal::unix::{signal, SignalKind};
use tower_http::trace::TraceLayer;

use crate::cache::Storage;
use crate::config::EnvCfg;
use crate::util::AppError;
use crate::{cache::Storage, config::EnvCfg, util::AppError};

const VERSION: &str = env!("CARGO_PKG_VERSION");

Expand Down

0 comments on commit a78643d

Please sign in to comment.