From f85ca98706602d809cb97eeff4c3efc4939b2687 Mon Sep 17 00:00:00 2001 From: Vaibhav Date: Tue, 6 Feb 2024 09:14:14 +0530 Subject: [PATCH] chore(notifications): use consistent formatting and style --- core/notifications/src/executor/config.rs | 1 + core/notifications/src/executor/error.rs | 3 +-- core/notifications/src/executor/fcm/mod.rs | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/notifications/src/executor/config.rs b/core/notifications/src/executor/config.rs index cb1ca6e471..512a6a0df8 100644 --- a/core/notifications/src/executor/config.rs +++ b/core/notifications/src/executor/config.rs @@ -25,6 +25,7 @@ pub struct NovuWorkflows { pub struct FcmConfig { pub service_account_key: Option, } + impl NovuWorkflows { pub fn for_name(&self, name: &str) -> String { match name { diff --git a/core/notifications/src/executor/error.rs b/core/notifications/src/executor/error.rs index 73725dd11b..cf7d681cc5 100644 --- a/core/notifications/src/executor/error.rs +++ b/core/notifications/src/executor/error.rs @@ -1,7 +1,6 @@ use thiserror::Error; -use super::fcm::error::FcmError; -use super::novu::error::NovuError; +use super::{fcm::error::FcmError, novu::error::NovuError}; use crate::user_notification_settings::error::*; #[derive(Error, Debug)] diff --git a/core/notifications/src/executor/fcm/mod.rs b/core/notifications/src/executor/fcm/mod.rs index 58a95009d8..91bf4168bf 100644 --- a/core/notifications/src/executor/fcm/mod.rs +++ b/core/notifications/src/executor/fcm/mod.rs @@ -29,9 +29,8 @@ impl FcmClient { .build(), ); let client = FirebaseCloudMessaging::new(hyper_client, auth); - Ok(Self { client }) - } else { - Err(FcmError::NoServiceAccountKey) + return Ok(Self { client }); } + Err(FcmError::NoServiceAccountKey) } }