From fd19dda5cb30ee46d83225a4fdb23aa7c34ce24e Mon Sep 17 00:00:00 2001 From: Matthias Ahouansou Date: Sun, 16 Jun 2024 17:28:05 +0100 Subject: [PATCH] ci: use nightly rustfmt we were using this before, but it broke when refactoring the flake out into separate files --- nix/shell.nix | 4 ++-- src/api/ruma_wrapper/axum.rs | 7 +++++-- src/service/globals/mod.rs | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nix/shell.nix b/nix/shell.nix index bd070fe6..584a6bb3 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -23,7 +23,7 @@ mkShell { }; # Development tools - nativeBuildInputs = default.nativeBuildInputs ++ [ + nativeBuildInputs = [ # Always use nightly rustfmt because most of its options are unstable # # This needs to come before `toolchain` in this list, otherwise @@ -57,5 +57,5 @@ mkShell { # Useful for editing the book locally mdbook - ]; + ] ++ default.nativeBuildInputs ; } diff --git a/src/api/ruma_wrapper/axum.rs b/src/api/ruma_wrapper/axum.rs index 047f7dcf..aaabb1c6 100644 --- a/src/api/ruma_wrapper/axum.rs +++ b/src/api/ruma_wrapper/axum.rs @@ -7,8 +7,11 @@ use axum::{ response::{IntoResponse, Response}, RequestExt, RequestPartsExt, }; -use axum_extra::headers::authorization::Bearer; -use axum_extra::{headers::Authorization, typed_header::TypedHeaderRejectionReason, TypedHeader}; +use axum_extra::{ + headers::{authorization::Bearer, Authorization}, + typed_header::TypedHeaderRejectionReason, + TypedHeader, +}; use bytes::{BufMut, BytesMut}; use http::{Request, StatusCode}; use ruma::{ diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index fc695f86..c22ffef3 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -1,9 +1,9 @@ mod data; -pub use data::Data; -pub use data::SigningKeys; -use ruma::MilliSecondsSinceUnixEpoch; -use ruma::{serde::Base64, OwnedDeviceId, OwnedEventId, OwnedRoomId, OwnedServerName, OwnedUserId}; -use ruma::{OwnedRoomAliasId, RoomAliasId}; +pub use data::{Data, SigningKeys}; +use ruma::{ + serde::Base64, MilliSecondsSinceUnixEpoch, OwnedDeviceId, OwnedEventId, OwnedRoomAliasId, + OwnedRoomId, OwnedServerName, OwnedUserId, RoomAliasId, +}; use crate::api::server_server::FedDest; @@ -16,7 +16,6 @@ use ruma::{ api::{client::sync::sync_events, federation::discovery::ServerSigningKeys}, DeviceId, RoomVersionId, ServerName, UserId, }; -use std::str::FromStr; use std::{ collections::{BTreeMap, HashMap}, error::Error as StdError, @@ -25,6 +24,7 @@ use std::{ iter, net::{IpAddr, SocketAddr}, path::PathBuf, + str::FromStr, sync::{ atomic::{self, AtomicBool}, Arc, RwLock as StdRwLock,