From 47e0d58d7e63f5704b36f4dfce2ab723e725389a Mon Sep 17 00:00:00 2001 From: Cesar Rodas Date: Thu, 5 Dec 2024 17:41:26 -0300 Subject: [PATCH] Minor improvement --- crates/cdk-axum/src/ws/subscribe.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/cdk-axum/src/ws/subscribe.rs b/crates/cdk-axum/src/ws/subscribe.rs index cfc021f4b..102c82425 100644 --- a/crates/cdk-axum/src/ws/subscribe.rs +++ b/crates/cdk-axum/src/ws/subscribe.rs @@ -15,17 +15,13 @@ pub(crate) async fn handle( return Err(WsError::InvalidParams); } - let mut subscription = if let Ok(subscription) = context + let mut subscription = context .state .mint .pubsub_manager .try_subscribe(params) .await - { - subscription - } else { - return Err(WsError::ParseError); - }; + .map_err(|_| WsError::InternalError)?; let publisher = context.publisher.clone(); context.subscriptions.insert(