Compare commits

...

2 Commits

Author SHA1 Message Date
8416ef0609 style: cargo fmt --all 2026-05-12 23:37:20 -04:00
3d2df64ffe fix: scope the vcs_watcher borrow to possibly fix deadlock 2026-05-12 23:37:08 -04:00
3 changed files with 9 additions and 7 deletions

View File

@@ -234,7 +234,7 @@ impl EventHandler for Handler {
#[tracing::instrument(skip(state))]
pub async fn handle(state: State, interaction: Interaction) {
let guild_and_voice_channel_id_res =
get_guild_and_voice_channel_id(&interaction, &state.vcs_watcher.borrow());
{ get_guild_and_voice_channel_id(&interaction, &state.vcs_watcher.borrow()) };
let (guild_id, voice_channel_id) = match guild_and_voice_channel_id_res {
Ok((guild_id, voice_channel_id)) => (guild_id, voice_channel_id),
Err(error) => {

View File

@@ -80,11 +80,13 @@ fn get_guild_and_vc_error_to_embed(error: GetGuildAndVoiceChannelIdError) -> Emb
#[tracing::instrument]
pub async fn handle(state: State, interaction: Interaction) {
let user_and_guild_and_voice_channel_id_res = get_user_and_guild_and_voice_channel_id(
state.discord_user_id,
&interaction,
&state.vcs_watcher.borrow(),
);
let user_and_guild_and_voice_channel_id_res = {
get_user_and_guild_and_voice_channel_id(
state.discord_user_id,
&interaction,
&state.vcs_watcher.borrow(),
)
};
let (user_id, guild_id, voice_channel_id) = match user_and_guild_and_voice_channel_id_res {
Ok((user_id, guild_id, voice_channel_id)) => (user_id, guild_id, voice_channel_id),
Err(error) => {

View File

@@ -14,7 +14,7 @@ impl FromStr for Storage {
fn from_str(s: &str) -> Result<Self, Self::Err> {
let uri = s.into_operator_uri()?;
let operator = Operator::from_uri(&uri)?;
let uri = uri.into();
Ok(Self { uri, operator })