format imports using rustfmt

This commit is contained in:
lemonsh 2023-01-22 18:14:43 +01:00
parent cb6afa7b9e
commit 85b664e37b
7 changed files with 51 additions and 38 deletions

2
rustfmt.toml Normal file
View File

@ -0,0 +1,2 @@
unstable_features = true
imports_granularity = "Crate"

View File

@ -1,10 +1,11 @@
use crate::history::MessageHistory;
use crate::util::{FancyRegexExt, OwnedCaptures};
use crate::ExecutorConnection;
use crate::{
history::MessageHistory,
util::{FancyRegexExt, OwnedCaptures},
ExecutorConnection,
};
use async_trait::async_trait;
use fancy_regex::Regex;
use std::collections::HashMap;
use std::sync::Arc;
use std::{collections::HashMap, sync::Arc};
use tokio::sync::mpsc;
#[async_trait]

View File

@ -1,5 +1,7 @@
use crate::bot::{Command, CommandContext};
use crate::database::Quote;
use crate::{
bot::{Command, CommandContext},
database::Quote,
};
use async_trait::async_trait;
use std::fmt::Write;

View File

@ -1,8 +1,10 @@
use crate::bot::{Trigger, TriggerContext};
use async_trait::async_trait;
use rspotify::clients::BaseClient;
use rspotify::model::{AlbumId, ArtistId, PlayableItem, PlaylistId, TrackId};
use rspotify::{ClientCredsSpotify, Credentials};
use rspotify::{
clients::BaseClient,
model::{AlbumId, ArtistId, PlayableItem, PlaylistId, TrackId},
ClientCredsSpotify, Credentials,
};
pub struct Spotify {
spotify: ClientCredsSpotify,

View File

@ -1,11 +1,13 @@
use rusqlite::{params, OptionalExtension, Params};
use serde::Serialize;
use std::collections::HashMap;
use tokio::sync::{
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
oneshot,
use tokio::{
sync::{
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
oneshot,
},
time::Instant,
};
use tokio::time::Instant;
#[derive(Debug)]
enum Task {

View File

@ -2,33 +2,38 @@
#![allow(clippy::module_name_repetitions, clippy::too_many_lines)]
use fancy_regex::Regex;
use std::str::FromStr;
use std::sync::Arc;
use std::{env, fs};
use std::{process, thread};
use std::{env, fs, process, str::FromStr, sync::Arc, thread};
use crate::bot::Bot;
use crate::commands::eval::Eval;
use crate::commands::help::Help;
use crate::commands::leek::{Leet, Mock, Owo};
use crate::commands::quotes::{Grab, Quot, Search, SearchNext};
use crate::commands::sed::Sed;
use crate::commands::spotify::Spotify;
use crate::commands::title::Title;
use crate::commands::waifu::Waifu;
use crate::web::HttpContext;
use crate::{
bot::Bot,
commands::{
eval::Eval,
help::Help,
leek::{Leet, Mock, Owo},
quotes::{Grab, Quot, Search, SearchNext},
sed::Sed,
spotify::Spotify,
title::Title,
waifu::Waifu,
},
web::HttpContext,
};
use futures_util::stream::StreamExt;
use irc::client::prelude::Config;
use irc::client::{Client, ClientStream};
use irc::proto::{ChannelExt, Command, Prefix};
use irc::{
client::{prelude::Config, Client, ClientStream},
proto::{ChannelExt, Command, Prefix},
};
use rspotify::Credentials;
use tokio::select;
use tokio::sync::mpsc::unbounded_channel;
use tokio::sync::{broadcast, mpsc};
use tokio::{
select,
sync::{broadcast, mpsc, mpsc::unbounded_channel},
};
use tracing::Level;
use crate::config::UberConfig;
use crate::database::{DbExecutor, ExecutorConnection};
use crate::{
config::UberConfig,
database::{DbExecutor, ExecutorConnection},
};
mod bot;
mod commands;

View File

@ -1,5 +1,4 @@
use std::collections::HashMap;
use std::ops::Range;
use std::{collections::HashMap, ops::Range};
pub struct OwnedCaptures {
text: String,