Unified · Split
| @@ -1,15 +1,11 @@ | |||
| 1 | use crate::loose::Db; | 1 | use crate::loose::Db; |
| 2 | use git_object::owned; | 2 | use git_object::owned; |
| 3 | use quick_error::quick_error; | ||
| 4 | use walkdir::WalkDir; | 3 | use walkdir::WalkDir; |
| 5 | 4 | ||
| 6 | quick_error! { | 5 | #[derive(thiserror::Error, Debug)] |
| 7 | #[derive(Debug)] | 6 | pub enum Error { |
| 8 | pub enum Error { | 7 | #[error(transparent)] |
| 9 | WalkDir(err: walkdir::Error) { | 8 | WalkDir(#[from] walkdir::Error), |
| 10 | source(err) | ||
| 11 | } | ||
| 12 | } | ||
| 13 | } | 9 | } |
| 14 | 10 | ||
| 15 | /// Iteration and traversal | 11 | /// Iteration and traversal |
| @@ -1,21 +1,13 @@ | |||
| 1 | use super::Status; | 1 | use super::Status; |
| 2 | use miniz_oxide::{deflate, deflate::core::CompressorOxide, MZError, MZFlush, MZStatus}; | 2 | use miniz_oxide::{deflate, deflate::core::CompressorOxide, MZError, MZFlush, MZStatus}; |
| 3 | use quick_error::quick_error; | ||
| 4 | use std::io; | 3 | use std::io; |
| 5 | 4 | ||
| 6 | quick_error! { | 5 | #[derive(thiserror::Error, Debug)] |
| 7 | #[derive(Debug)] | 6 | pub enum Error { |
| 8 | pub enum Error { | 7 | #[error("Need dictionary")] |
| 9 | Compression { | 8 | ZLibNeedDict, |
| 10 | display("The compression failed due to an unknown error") | 9 | #[error("A compression error occurred: {0:?}")] |
| 11 | } | 10 | Error(MZError), |
| 12 | ZLibNeedDict { | ||
| 13 | display("Need dictionary") | ||
| 14 | } | ||
| 15 | Error(err: MZError) { | ||
| 16 | display("A compression error occurred: {:?}", err) | ||
| 17 | } | ||
| 18 | } | ||
| 19 | } | 11 | } |
| 20 | 12 | ||
| 21 | pub struct Deflate { | 13 | pub struct Deflate { |