mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 01:00:49 +00:00
Apply automatic clippy
This commit is contained in:
parent
054a7d5862
commit
b9f6fa7fb8
14 changed files with 49 additions and 43 deletions
|
@ -77,7 +77,7 @@ impl MemberToChannels {
|
|||
/// Gets the channel list of an user related to that channel.
|
||||
pub async fn channels_of(
|
||||
&self,
|
||||
http: impl CacheHttp + Clone + Sync,
|
||||
http: impl CacheHttp + Clone,
|
||||
u: impl Into<UserId>,
|
||||
) -> Vec<ChannelId> {
|
||||
let u: UserId = u.into();
|
||||
|
@ -105,6 +105,12 @@ pub struct AnnouncerHandler {
|
|||
}
|
||||
|
||||
/// Announcer-managing related.
|
||||
impl Default for AnnouncerHandler {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl AnnouncerHandler {
|
||||
/// Create a new instance of the handler.
|
||||
pub fn new() -> Self {
|
||||
|
@ -119,7 +125,7 @@ impl AnnouncerHandler {
|
|||
pub fn add(
|
||||
&mut self,
|
||||
key: &'static str,
|
||||
announcer: impl Announcer + Send + Sync + 'static,
|
||||
announcer: impl Announcer + Sync + 'static,
|
||||
) -> &mut Self {
|
||||
if self
|
||||
.announcers
|
||||
|
@ -136,12 +142,12 @@ impl AnnouncerHandler {
|
|||
}
|
||||
|
||||
pub fn run(self, client: &Client) -> AnnouncerRunner {
|
||||
let runner = AnnouncerRunner {
|
||||
|
||||
AnnouncerRunner {
|
||||
cache_http: CacheAndHttp::from_client(client),
|
||||
data: client.data.clone(),
|
||||
announcers: self.announcers,
|
||||
};
|
||||
runner
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ pub async fn setup_prelude(
|
|||
// Set up the SQL client.
|
||||
data.insert::<crate::SQLClient>(sql_pool.clone());
|
||||
|
||||
let env = Env {
|
||||
|
||||
|
||||
Env {
|
||||
http: http_client,
|
||||
sql: sql_pool,
|
||||
members: member_cache,
|
||||
};
|
||||
|
||||
env
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue