diff --git a/Cargo.toml b/Cargo.toml index e4284a2..35fa188 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,20 +5,16 @@ edition = "2021" [dependencies] poise = "0.6.1" -poise_macros = "0.6.1" tokio = { version = "1.41.0", features = ["rt-multi-thread"] } chrono = { version = "0.4.38", features = ["serde"] } human_ids = "0.1.1" -once_cell = { version = "1.20.2", features = ["std"] } serde = { version = "1.0.214", features = ["alloc", "derive"] } thiserror = "1.0.65" -tracing = { version = "0.1.40", features = ["async-await", "std"] } simplelog = { version = "0.12.2", features = ["paris"] } log = { version = "0.4.22", features = ["std"] } nom = "7.1.3" criterion = "0.5" serde_json = { version = "1.0.132", features = ["alloc"] } -postcard = { version = "1.0.10", features = ["alloc"] } ron = "0.8.1" distance = "0.4.0" diff --git a/src/config.rs b/src/config.rs index 1311e0d..8b690a0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -94,6 +94,7 @@ impl GlobalConfig { } /// Generate the custom emote variant of the reactions + #[cfg(not(tarpaulin_include))] fn emotes() -> WeeklyReactionList { vec![ ReactionType::Custom { diff --git a/src/votes/helper_functions.rs b/src/votes/helper_functions.rs index bcf92eb..ba48d1c 100644 --- a/src/votes/helper_functions.rs +++ b/src/votes/helper_functions.rs @@ -42,7 +42,6 @@ pub fn add_pending_event( .pending_events .lock() .unwrap() - // .map_err(|_| IdleError::MutexError)? .add_pending_event(event) } @@ -64,12 +63,7 @@ pub fn add_pending_event( /// make_into_ongoing_event(&id, &ev_ctx).unwrap() /// ``` pub fn make_into_ongoing_event(huid: &EventIdType, ev_ctx: &EventHolder) -> Result<(), IdleError> { - ev_ctx - .pending_events - .lock() - .unwrap() - // .map_err(|_| IdleError::MutexError)? - .launch(huid, ev_ctx) + ev_ctx.pending_events.lock().unwrap().launch(huid, ev_ctx) } /// Manually adds an ongoing event. @@ -100,7 +94,6 @@ pub fn add_ongoing_event( .ongoing_events .lock() .unwrap() - // .map_err(|_| IdleError::MutexError)? .add_event(huid, event)?; Ok(()) } @@ -126,12 +119,7 @@ pub fn del_ongoing_event( huid: &EventIdType, ev_ctx: &EventHolder, ) -> Result { - ev_ctx - .ongoing_events - .lock() - .unwrap() - // .map_err(|_| IdleError::MutexError)? - .del_event(huid) + ev_ctx.ongoing_events.lock().unwrap().del_event(huid) } /// Destroy a pending event without closing it @@ -153,12 +141,7 @@ pub fn del_pending_event( huid: &EventIdType, ev_ctx: &EventHolder, ) -> Result { - ev_ctx - .pending_events - .lock() - .unwrap() - // .map_err(|_| IdleError::MutexError)? - .del_event(huid) + ev_ctx.pending_events.lock().unwrap().del_event(huid) } /// This function is used to close an ongoing event and return the parsed vote associated with it. If the closure is successful, the owned event is returned for post-treatment. @@ -181,7 +164,6 @@ pub fn close_ongoing_event(huid: &EventIdType, ev_ctx: &EventHolder) -> Result<( .ongoing_events .lock() .unwrap() - // .map_err(|_| IdleError::MutexError)? .close_event(huid, ev_ctx) }