-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eco): New binary "eco" and normalization of api
- Loading branch information
Showing
37 changed files
with
580 additions
and
299 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![deny(clippy::all, clippy::pedantic)] | ||
|
||
use std::{ | ||
fs::{File, OpenOptions}, | ||
io::{Cursor, Read, Seek, Write}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
use std::{io, result}; | ||
|
||
use zip::result::ZipError; | ||
|
||
#[derive(Debug, thiserror::Error)] | ||
pub enum Error { | ||
#[error("IO error {0}")] | ||
IO(#[from] io::Error), | ||
#[error("io error {0}")] | ||
IO(#[from] std::io::Error), | ||
|
||
#[error("Zip error {0}")] | ||
#[error("zip error {0}")] | ||
Zip(#[from] ZipError), | ||
|
||
#[error("Cbz file size couldn't be converted")] | ||
#[error("cbz file size couldn't be converted")] | ||
CbzFileSizeConversion, | ||
|
||
#[error("Cbz file name is empty")] | ||
#[error("cbz file name is empty")] | ||
CbzFileNameEmpty, | ||
|
||
#[error("Cbz file invalid index {0}")] | ||
#[error("cbz file invalid index {0}")] | ||
CbzFileInvalidIndex(String), | ||
|
||
#[error("File at index {0} not found in cbz")] | ||
#[error("file at index {0} not found in cbz")] | ||
CbzNotFound(usize), | ||
|
||
#[error("Cbz is too large, it can contain a maximum of {0} files")] | ||
#[error("cbz is too large, it can contain a maximum of {0} files")] | ||
CbzTooLarge(usize), | ||
|
||
#[error("Cbz file insertion's extension not provided")] | ||
#[error("cbz file insertion's extension not provided")] | ||
CbzInsertionNoExtension, | ||
|
||
#[error("Cbz file insertion: no bytes set")] | ||
#[error("cbz file insertion: no bytes set")] | ||
CbzInsertionNoBytes, | ||
|
||
#[error("Cbz metadata is too large: {0} > 65,535")] | ||
#[error("cbz metadata is too large: {0} > 65,535")] | ||
CbzMetadataSize(usize), | ||
|
||
#[error("Image error: {0}")] | ||
#[error("image error: {0}")] | ||
Image(#[from] image::ImageError), | ||
|
||
#[cfg(feature = "metadata")] | ||
#[error("Metadata error: {0}")] | ||
#[error("metadata error: {0}")] | ||
MetadataFormat(#[from] serde_json::Error), | ||
|
||
#[cfg(feature = "metadata")] | ||
#[error("Metadata value error: {0}")] | ||
#[error("metadata value error: {0}")] | ||
MetadataValue(String), | ||
} | ||
|
||
pub type Result<T, E = Error> = result::Result<T, E>; | ||
pub type Result<T, E = Error> = std::result::Result<T, E>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![deny(clippy::all, clippy::pedantic)] | ||
|
||
pub mod cbz; | ||
pub mod cbz_metadata; | ||
pub mod errors; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.