From 5bc9dc01618421596d65a7046e46559a872c6693 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Mon, 25 Aug 2025 22:38:19 -0400 Subject: Group Rust imports by crate. I've been doing this by hand anyways, and this makes it a _ton_ less tedious to maintain. I think it looks nice. This does, however, require nightly - for formatting only. --- src/boot/mod.rs | 2 +- src/conversation/handlers/send/mod.rs | 2 +- src/empty.rs | 6 ++++-- src/id.rs | 3 +-- src/setup/required.rs | 6 ++++-- 5 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/boot/mod.rs b/src/boot/mod.rs index e0d35d9..90a957d 100644 --- a/src/boot/mod.rs +++ b/src/boot/mod.rs @@ -1,4 +1,4 @@ -use crate::{event::Event, event::Sequence}; +use crate::event::{Event, Sequence}; pub mod app; pub mod handlers; diff --git a/src/conversation/handlers/send/mod.rs b/src/conversation/handlers/send/mod.rs index 9ec020a..1c8ac63 100644 --- a/src/conversation/handlers/send/mod.rs +++ b/src/conversation/handlers/send/mod.rs @@ -4,10 +4,10 @@ use axum::{ response::{self, IntoResponse}, }; -use crate::conversation::handlers::PathInfo; use crate::{ app::App, clock::RequestedAt, + conversation::handlers::PathInfo, error::{Internal, NotFound}, message::{Body, Message, app::SendError}, token::extract::Identity, diff --git a/src/empty.rs b/src/empty.rs index 2c66051..3126c42 100644 --- a/src/empty.rs +++ b/src/empty.rs @@ -1,5 +1,7 @@ -use axum::http::StatusCode; -use axum::response::{IntoResponse, Response}; +use axum::{ + http::StatusCode, + response::{IntoResponse, Response}, +}; #[derive(Debug)] pub struct Empty; diff --git a/src/id.rs b/src/id.rs index 86cdf8a..d668cc9 100644 --- a/src/id.rs +++ b/src/id.rs @@ -2,8 +2,7 @@ use std::fmt; use rand::{seq::SliceRandom, thread_rng}; use serde::{Deserializer, Serializer}; -use sqlx::encode::IsNull; -use sqlx::{Database, Decode, Encode, Type}; +use sqlx::{Database, Decode, Encode, Type, encode::IsNull}; // Make IDs that: // diff --git a/src/setup/required.rs b/src/setup/required.rs index 2112e4b..7276827 100644 --- a/src/setup/required.rs +++ b/src/setup/required.rs @@ -3,8 +3,10 @@ use axum::{ http::StatusCode, response::{IntoResponse, Response}, }; -use std::pin::Pin; -use std::task::{Context, Poll}; +use std::{ + pin::Pin, + task::{Context, Poll}, +}; use tower::{Layer, Service}; use crate::{app::App, error::Internal}; -- cgit v1.2.3