History

chore: replace `quick-error` with `thiserror`

This increases the compile time of the crate alone if there is no proc-macro in the dependency tree, but will ever so slightly improve compile times for `gix` as a whole.

Sebastian Thiel committed 3 years ago

Commit d09656b1 parent 7ca60e93 files · +14 −15Browse files

Unified · Split

3 files
  1. Cargo.lock +1 −1
  2. gix-mailmap/Cargo.toml +1 −1
  3. gix-mailmap/src/parse.rs +12 −13
Cargo.lock+1−1
@@ -1800,8 +1800,8 @@ dependencies = [ · 1799 unmodified lines
18001800 "document-features",
18011801 "gix-actor 0.17.2",
18021802 "gix-testtools",
1803− "quick-error 2.0.1",
18041803 "serde",
1804+ "thiserror",
18051805 ]
18061806
18071807 [[package]]
gix-mailmap/Cargo.toml+1−1
@@ -18,7 +18,7 @@ serde1 = ["serde", "bstr/serde", "gix-actor/serde1"] · 17 unmodified lines
1818 [dependencies]
1919 gix-actor = { version = "^0.17.2", path = "../gix-actor" }
2020 bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
21−quick-error = "2.0.0"
21+thiserror = "1.0.38"
2222 serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2323
2424 document-features = { version = "0.2.0", optional = true }
gix-mailmap/src/parse.rs+12−13
@@ -1,19 +1,18 @@
11 mod error {
22 use bstr::BString;
3− use quick_error::quick_error;
43
5− quick_error! {
6− /// The error returned by [`parse()`][crate::parse()].
7− #[derive(Debug)]
8− #[allow(missing_docs)]
9− pub enum Error {
10− UnconsumedInput { line_number: usize, line: BString } {
11− display("Line {} has too many names or emails, or none at all: {}", line_number, line)
12− }
13− Malformed { line_number: usize, line: BString, message: String } {
14− display("{}: {:?}: {}", line_number, line, message)
15− }
16− }
4+ /// The error returned by [`parse()`][crate::parse()].
5+ #[derive(Debug, thiserror::Error)]
6+ #[allow(missing_docs)]
7+ pub enum Error {
8+ #[error("Line {line_number} has too many names or emails, or none at all: {line:?}")]
9+ UnconsumedInput { line_number: usize, line: BString },
10+ #[error("{line_number}: {line:?}: {message}")]
11+ Malformed {
12+ line_number: usize,
13+ line: BString,
14+ message: String,
15+ },
1716 }
1817 }
1918