From d34403eddc75188b1657a7076442b48da76bb727 Mon Sep 17 00:00:00 2001 From: A Farzat Date: Tue, 3 Mar 2026 18:38:23 +0300 Subject: Remove the sanity checks They are no longer needed. --- src/main.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 002f669..3c5956e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,13 +2,12 @@ mod epub; mod http_client; mod models; -use std::collections::HashMap; use std::path::Path; use crate::epub::{create_epub_archive, download_all_files}; use crate::http_client::build_authenticated_client; use crate::models::{Chapter, EpubResponse, FileEntry, Paginated, SpineItem, TocNode}; -use anyhow::{Context, Result, ensure}; +use anyhow::{Context, Result}; use clap::Parser; use reqwest::Client; @@ -119,24 +118,5 @@ async fn main() -> Result<()> { let epub_path = Path::new(&epub_path); create_epub_archive(dest_root, &epub_path, &file_entries)?; - // Sanity check: Every entry in spine exists in chapters. - let chapters: HashMap = - chapters.into_iter().map(|c| (c.ourn.clone(), c)).collect(); - for s in spine_items { - ensure!(chapters.contains_key(&s.ourn), "{} not in chapters", s.ourn); - } - // Sanity check: Every node in the ToC references a file entry. - let file_entries: HashMap = file_entries - .into_iter() - .map(|f| (f.ourn.clone(), f)) - .collect(); - for i in toc_vec { - ensure!( - file_entries.contains_key(&i.ourn), - "{} not in files", - i.ourn - ); - } - Ok(()) } -- cgit v1.2.3-70-g09d2