mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
chore: bump rust edition to 2024
This commit is contained in:
parent
214f164fbc
commit
ebb23286d8
41 changed files with 70 additions and 69 deletions
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "gateway"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
anyhow = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
use axum::{
|
||||
Router,
|
||||
extract::{ConnectInfo, Path, State},
|
||||
http::StatusCode,
|
||||
response::{IntoResponse, Response},
|
||||
routing::{delete, get, post},
|
||||
Router,
|
||||
};
|
||||
use libpk::runtime_config::RuntimeConfig;
|
||||
use serde_json::{json, to_string};
|
||||
use tracing::{error, info};
|
||||
use twilight_model::id::{marker::ChannelMarker, Id};
|
||||
use twilight_model::id::{Id, marker::ChannelMarker};
|
||||
|
||||
use crate::{
|
||||
discord::{
|
||||
cache::{dm_channel, DiscordCache, DM_PERMISSIONS},
|
||||
cache::{DM_PERMISSIONS, DiscordCache, dm_channel},
|
||||
gateway::cluster_config,
|
||||
shard_state::ShardStateManager,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,18 +4,18 @@ use serde::Serialize;
|
|||
use std::{collections::HashMap, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
use twilight_cache_inmemory::{
|
||||
InMemoryCache, ResourceType,
|
||||
model::CachedMember,
|
||||
permission::{MemberRoles, RootError},
|
||||
traits::CacheableChannel,
|
||||
InMemoryCache, ResourceType,
|
||||
};
|
||||
use twilight_gateway::Event;
|
||||
use twilight_model::{
|
||||
channel::{Channel, ChannelType},
|
||||
guild::{Guild, Member, Permissions},
|
||||
id::{
|
||||
marker::{ChannelMarker, GuildMarker, MessageMarker, UserMarker},
|
||||
Id,
|
||||
marker::{ChannelMarker, GuildMarker, MessageMarker, UserMarker},
|
||||
},
|
||||
};
|
||||
use twilight_util::permission_calculator::PermissionCalculator;
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@ use std::sync::Arc;
|
|||
use tokio::sync::mpsc::Sender;
|
||||
use tracing::{error, info, warn};
|
||||
use twilight_gateway::{
|
||||
create_iterator, CloseFrame, ConfigBuilder, Event, EventTypeFlags, Message, Shard, ShardId,
|
||||
CloseFrame, ConfigBuilder, Event, EventTypeFlags, Message, Shard, ShardId, create_iterator,
|
||||
};
|
||||
use twilight_model::gateway::{
|
||||
Intents,
|
||||
payload::outgoing::update_presence::UpdatePresencePayload,
|
||||
presence::{Activity, ActivityType, Status},
|
||||
Intents,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
discord::identify_queue::{self, RedisQueue},
|
||||
RUNTIME_CONFIG_KEY_EVENT_TARGET,
|
||||
discord::identify_queue::{self, RedisQueue},
|
||||
};
|
||||
|
||||
use super::cache::DiscordCache;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// - interaction: (custom_id where not_includes "help-menu")
|
||||
|
||||
use std::{
|
||||
collections::{hash_map::Entry, HashMap},
|
||||
collections::{HashMap, hash_map::Entry},
|
||||
net::{IpAddr, SocketAddr},
|
||||
time::Duration,
|
||||
};
|
||||
|
|
@ -15,8 +15,8 @@ use twilight_gateway::Event;
|
|||
use twilight_model::{
|
||||
application::interaction::InteractionData,
|
||||
id::{
|
||||
marker::{ChannelMarker, MessageMarker, UserMarker},
|
||||
Id,
|
||||
marker::{ChannelMarker, MessageMarker, UserMarker},
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -103,7 +103,13 @@ impl EventAwaiter {
|
|||
}
|
||||
}
|
||||
}
|
||||
info!("ran event_awaiter cleanup loop, took {}us, {} reactions, {} messages, {} interactions", Instant::now().duration_since(now).as_micros(), counts.0, counts.1, counts.2);
|
||||
info!(
|
||||
"ran event_awaiter cleanup loop, took {}us, {} reactions, {} messages, {} interactions",
|
||||
Instant::now().duration_since(now).as_micros(),
|
||||
counts.0,
|
||||
counts.1,
|
||||
counts.2
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ use axum::{
|
|||
extract::MatchedPath, extract::Request, http::StatusCode, middleware::Next, response::Response,
|
||||
};
|
||||
use metrics::{counter, histogram};
|
||||
use tracing::{info, span, warn, Instrument, Level};
|
||||
use tracing::{Instrument, Level, info, span, warn};
|
||||
|
||||
// log any requests that take longer than 2 seconds
|
||||
// todo: change as necessary
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#![feature(let_chains)]
|
||||
#![feature(if_let_guard)]
|
||||
#![feature(duration_constructors)]
|
||||
|
||||
|
|
@ -10,7 +9,7 @@ use libpk::{runtime_config::RuntimeConfig, state::ShardStateEvent};
|
|||
use reqwest::{ClientBuilder, StatusCode};
|
||||
use std::{sync::Arc, time::Duration, vec::Vec};
|
||||
use tokio::{
|
||||
signal::unix::{signal, SignalKind},
|
||||
signal::unix::{SignalKind, signal},
|
||||
sync::mpsc::channel,
|
||||
task::JoinSet,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue