From ab01daafeaa9da1209f08ca946893f3dd0a3aad5 Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 4 Jun 2026 21:11:40 -0400 Subject: [PATCH] Change return type (#5) Reviewed-on: http://git.kundeng.us/phoenix/swoosh/pulls/5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/twilio/api/mod.rs | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 804e9cd..6e9529e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1573,7 +1573,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "swoosh" -version = "0.3.0" +version = "0.3.1" dependencies = [ "base64-ng", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 0917518..74b6601 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "swoosh" -version = "0.3.0" +version = "0.3.1" edition = "2024" rust-version = "1.95" description = "Library to send text messages" diff --git a/src/twilio/api/mod.rs b/src/twilio/api/mod.rs index 86d589d..1fae6d4 100644 --- a/src/twilio/api/mod.rs +++ b/src/twilio/api/mod.rs @@ -1,5 +1,12 @@ pub mod types; +pub async fn response_to_json(response: reqwest::Response) -> serde_json::Value { + match response.json().await { + Ok(json_body) => json_body, + Err(_err) => serde_json::Value::Null, + } +} + pub async fn send_mssage( msg: &textsender_models::message::Message, contact: &textsender_models::contact::Contact,