diff options
| author | A Farzat <a@farzat.xyz> | 2026-03-05 16:21:38 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-03-05 16:21:38 +0300 |
| commit | 598ee0199a50d30d06f4a2fa67bed5943c6452b4 (patch) | |
| tree | 6274ae4a896eace66c57074e364e0e3499c70c83 /src/models.rs | |
| parent | 71727a58aa8dac17cf7eeb37f79f1ab318bd66a2 (diff) | |
| download | oreilly-epub-598ee0199a50d30d06f4a2fa67bed5943c6452b4.tar.gz oreilly-epub-598ee0199a50d30d06f4a2fa67bed5943c6452b4.zip | |
Deserialize URLs to Url type directly
This saves the effort of having to do it manually later on. Also avoids
duplication in parsing.
Diffstat (limited to 'src/models.rs')
| -rw-r--r-- | src/models.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/models.rs b/src/models.rs index a3183e6..6035ce1 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,5 +1,6 @@ use relative_path::RelativePathBuf; use serde::Deserialize; +use url::Url; /// Generic Model for paginated API. #[derive(Debug, serde::Deserialize)] @@ -30,7 +31,7 @@ pub struct Chapter { #[derive(Debug, Deserialize)] pub struct FileEntry { pub ourn: String, - pub url: String, + pub url: Url, pub full_path: RelativePathBuf, pub media_type: String, pub filename: String, |
