From 26d8aed5540677d539957dea16f95491499eff58 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Fri, 29 Nov 2024 12:36:59 +0100 Subject: Use Expo on the AppState This because since Rust 1.83 it is suggested to not use the static reference cloning --- src/errors.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 3dda65c..5f2a8dd 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -96,3 +96,10 @@ impl From for AppError { AppError::BadRequest(value.message) } } + +/// A expo_push_notification_client::ValidationError is mapped to an `AppError::BadRequest` +impl From for AppError { + fn from(value: expo_push_notification_client::ValidationError) -> Self { + AppError::BadRequest(value.to_string()) + } +} -- cgit v1.2.3-18-g5258