Updated Ratatui, created custom deserialization logic for i64s to make life easier, and used string interpolation where possible to reduce the lines needed to write log messages or create formatted text

This commit is contained in:
2023-09-07 17:20:38 -06:00
parent e13d1ece58
commit b16a58deae
43 changed files with 426 additions and 536 deletions
+12 -1
View File
@@ -2,7 +2,8 @@ use std::cell::RefCell;
use std::fmt::{Debug, Display, Formatter};
use crate::models::servarr_data::radarr::radarr_data::ActiveRadarrBlock;
use serde::Deserialize;
use serde::{de, Deserialize, Deserializer};
use serde_json::Number;
use tui::widgets::{ListState, TableState};
pub mod radarr_models;
@@ -409,3 +410,13 @@ where
self.index = index;
}
}
pub fn from_i64<'de, D>(deserializer: D) -> Result<i64, D::Error>
where
D: Deserializer<'de>,
{
let num: Number = Deserialize::deserialize(deserializer)?;
num.as_i64().ok_or(de::Error::custom(format!(
"Unable to convert Number to i64: {num:?}"
)))
}