fix: Update to be compatible with epub-builder >0.6
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful

This commit is contained in:
Paul Campbell 2024-03-10 18:32:11 +00:00
parent 52c362fdf0
commit ab086a98ab
4 changed files with 8 additions and 9 deletions

5
Cargo.lock generated
View file

@ -1558,6 +1558,7 @@ dependencies = [
"derive_builder",
"directories",
"epub-builder",
"eyre",
"flexi_logger",
"futures",
"html5ever",
@ -2504,9 +2505,9 @@ dependencies = [
[[package]]
name = "typenum"
version = "1.13.0"
version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
[[package]]
name = "unicase"

View file

@ -22,6 +22,7 @@ comfy-table = "3.0.0"
derive_builder = "0.20.0"
directories = "5.0.1"
epub-builder = "0.7.4"
eyre = "0.6"
flexi_logger = "0.27.4"
futures = "0.3.30"
html5ever = "0.25.1"

View file

@ -249,10 +249,7 @@ fn replace_escaped_characters(value: &str) -> String {
.replace(">", ">")
}
fn add_stylesheets<T: epub_builder::Zip>(
epub: &mut EpubBuilder<T>,
app_config: &AppConfig,
) -> Result<(), epub_builder::Error> {
fn add_stylesheets(epub: &mut EpubBuilder<ZipLibrary>, app_config: &AppConfig) -> eyre::Result<()> {
let body_stylesheet: &[u8] = include_bytes!("./assets/body.min.css");
let header_stylesheet: &[u8] = include_bytes!("./assets/headers.min.css");
match app_config.css_config {

View file

@ -98,9 +98,9 @@ impl From<ErrorKind> for PaperoniError {
}
}
impl From<epub_builder::Error> for PaperoniError {
fn from(err: epub_builder::Error) -> Self {
PaperoniError::with_kind(ErrorKind::EpubError(err.description().to_owned()))
impl From<eyre::Error> for PaperoniError {
fn from(err: eyre::Error) -> Self {
PaperoniError::with_kind(ErrorKind::EpubError(err.to_string()))
}
}