chore: annotate unused code with #[allow(dead_code)]
Some checks failed
build / checks-build (push) Has been cancelled
build / codecov (push) Has been cancelled
docs / docs (push) Has been cancelled
build / checks-matrix (push) Has been cancelled

This commit is contained in:
uttarayan21
2025-10-08 16:20:27 +05:30
parent a8f0ab160e
commit 8139fe4cb3
4 changed files with 13 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ impl SonarrClient {
serde_path_to_error::deserialize(deser).map_err(ApiError::from)
}
#[allow(dead_code)]
async fn get_debug<T: for<'de> Deserialize<'de>>(&self, endpoint: &str) -> Result<T> {
let url = format!("{}/api/v3{}", self.base_url, endpoint);
let response = self
@@ -68,12 +69,13 @@ impl SonarrClient {
}
let text = response.text().await?;
std::fs::write(endpoint.replace("/", "_"), &text);
let _ = std::fs::write(endpoint.replace("/", "_"), &text);
let deser = &mut serde_json::Deserializer::from_str(&text);
serde_path_to_error::deserialize(deser).map_err(ApiError::from)
}
#[allow(dead_code)]
async fn post<T: Serialize, R: for<'de> Deserialize<'de>>(
&self,
endpoint: &str,
@@ -107,10 +109,12 @@ impl SonarrClient {
self.get("/series").await
}
#[allow(dead_code)]
pub async fn get_series_by_id(&self, id: u32) -> Result<Series> {
self.get(&format!("/series/{}", id)).await
}
#[allow(dead_code)]
pub async fn get_episodes(
&self,
series_id: Option<u32>,
@@ -163,6 +167,7 @@ impl SonarrClient {
self.get("/history").await
}
#[allow(dead_code)]
pub async fn get_missing_episodes(&self) -> Result<EpisodePagingResource> {
self.get("/wanted/missing").await
}
@@ -179,6 +184,7 @@ impl SonarrClient {
.await
}
#[allow(dead_code)]
pub async fn add_series(&self, series: &Series) -> Result<Series> {
self.post("/series", series).await
}

View File

@@ -3,4 +3,5 @@
#[error("An error occurred")]
pub struct Error;
#[allow(dead_code)]
pub type Result<T, E = error_stack::Report<Error>> = core::result::Result<T, E>;

View File

@@ -1,3 +1,4 @@
#[deny(warnings)]
mod api;
mod cli;
mod config;

View File

@@ -31,6 +31,7 @@ pub enum AppEvent {
Key(crossterm::event::KeyEvent),
Error(String),
SeriesLoaded(Vec<Series>),
#[allow(dead_code)]
EpisodesLoaded(Vec<Episode>),
QueueLoaded(Vec<QueueItem>),
HistoryLoaded(Vec<HistoryItem>),
@@ -101,6 +102,7 @@ pub struct App {
pub health: Vec<HealthResource>,
pub calendar: Vec<Episode>,
pub system_status: Option<SystemStatus>,
#[allow(dead_code)]
pub selected_series: Option<Series>,
pub loading: bool,
pub error_message: Option<String>,
@@ -346,6 +348,7 @@ impl App {
}
}
#[allow(dead_code)]
pub fn get_selected_series(&self) -> Option<&Series> {
if let Some(index) = self.series_list_state.selected() {
self.series.get(index)
@@ -354,6 +357,7 @@ impl App {
}
}
#[allow(dead_code)]
pub fn get_selected_search_result(&self) -> Option<&Series> {
if let Some(index) = self.search_list_state.selected() {
self.search_results.get(index)