Skip to content

Commit d686d94

Browse files
committed
Merge branch 'adjustments-for-cargo'
2 parents ad23f1d + b2375e3 commit d686d94

File tree

45 files changed

+373
-246
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+373
-246
lines changed

Cargo.lock

Lines changed: 14 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ default = ["max"]
2828
## Makes the crate execute as fast as possible by supporting parallel computation of otherwise long-running functions
2929
## as well as fast, hardware accelerated hashing, along with a faster zlib backend.
3030
## If disabled, the binary will be visibly smaller.
31-
fast = ["gix/max-performance"]
31+
fast = ["gix/max-performance", "gix/comfort"]
3232

3333
## Use `clap` 3.0 to build the prettiest, best documented and most user-friendly CLI at the expense of binary size.
3434
## Provides a terminal user interface for detailed and exhaustive progress.
@@ -57,7 +57,7 @@ lean-async = ["fast", "pretty-cli", "gitoxide-core-tools", "gitoxide-core-tools-
5757
small = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "prodash-render-line", "is-terminal" ]
5858

5959
## Makes the crate execute as fast as possible without pulling in C libraries, while keeping everything else minimal akin to the `small` build.
60-
max-pure = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "prodash-render-line", "prodash-render-tui", "gix/max-performance-safe", "http-client-reqwest", "gitoxide-core-blocking-client", "gitoxide-core-tools", "prodash/render-line-autoconfigure" ]
60+
max-pure = ["pretty-cli", "gix-features/rustsha1", "gix-features/zlib-rust-backend", "prodash-render-line", "prodash-render-tui", "gix/max-performance-safe", "gix/comfort", "http-client-reqwest", "gitoxide-core-blocking-client", "gitoxide-core-tools", "prodash/render-line-autoconfigure" ]
6161

6262
#! ### `gitoxide-core` Configuration
6363

@@ -93,7 +93,7 @@ gix = { version = "^0.38.0", path = "gix", default-features = false }
9393
time = "0.3.19"
9494

9595
clap = { version = "4.1.1", features = ["derive", "cargo"] }
96-
prodash = { version = "23.0", optional = true, default-features = false }
96+
prodash = { version = "23.1", optional = true, default-features = false }
9797
is-terminal = { version = "0.4.0", optional = true }
9898
env_logger = { version = "0.10.0", default-features = false }
9999
crosstermion = { version = "0.10.1", optional = true, default-features = false }

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ check: ## Build all code in suitable configurations
7373
cd gix-hash && cargo check --all-features \
7474
&& cargo check
7575
cd gix-tempfile && cargo check --features signals \
76+
&& cargo check --features hp-hashmap \
7677
&& cargo check
7778
cd gix-object && cargo check --all-features \
7879
&& cargo check --features verbose-object-parsing-errors
@@ -135,6 +136,7 @@ check: ## Build all code in suitable configurations
135136
&& cargo check --no-default-features --features blocking-http-transport-reqwest \
136137
&& cargo check --no-default-features --features max-performance \
137138
&& cargo check --no-default-features --features max-performance-safe \
139+
&& cargo check --no-default-features --features progress-tree \
138140
&& cargo check --no-default-features
139141
cd gix-odb && cargo check --features serde1
140142
cd cargo-smart-release && cargo check --all

gix-actor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ serde1 = ["serde", "bstr/serde", "gix-date/serde1"]
2020
gix-features = { version = "^0.26.5", path = "../gix-features", optional = true }
2121
gix-date = { version = "^0.4.3", path = "../gix-date" }
2222

23-
quick-error = "2.0.0"
23+
thiserror = "1.0.38"
2424
btoi = "0.4.2"
2525
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
2626
nom = { version = "7", default-features = false, features = ["std"]}

gix-actor/src/signature/mod.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,15 @@ mod write {
7878
use std::io;
7979

8080
use bstr::{BStr, ByteSlice};
81-
use quick_error::quick_error;
8281

8382
use crate::{Signature, SignatureRef};
8483

85-
quick_error! {
86-
/// The Error produced by [`Signature::write_to()`].
87-
#[derive(Debug)]
88-
#[allow(missing_docs)]
89-
enum Error {
90-
IllegalCharacter {
91-
display("Signature name or email must not contain '<', '>' or \\n")
92-
}
93-
}
84+
/// The Error produced by [`Signature::write_to()`].
85+
#[derive(Debug, thiserror::Error)]
86+
#[allow(missing_docs)]
87+
enum Error {
88+
#[error("Signature name or email must not contain '<', '>' or \\n")]
89+
IllegalCharacter,
9490
}
9591

9692
impl From<Error> for io::Error {

gix-attributes/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ doctest = false
1414

1515
[features]
1616
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
17-
serde1 = ["serde", "bstr/serde", "gix-glob/serde1", "compact_str/serde"]
17+
serde1 = ["serde", "bstr/serde", "gix-glob/serde1"]
1818

1919
[dependencies]
2020
gix-features = { version = "^0.26.5", path = "../gix-features" }
@@ -26,7 +26,6 @@ bstr = { version = "1.3.0", default-features = false, features = ["std", "unicod
2626
unicode-bom = "1.1.4"
2727
thiserror = "1.0.26"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
29-
compact_str = "0.6.1"
3029

3130
document-features = { version = "0.2.1", optional = true }
3231

gix-attributes/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use std::path::PathBuf;
1313

1414
use bstr::{BStr, BString};
15-
use compact_str::CompactString;
1615
pub use gix_glob as glob;
1716

1817
mod assignment;
@@ -60,15 +59,15 @@ pub enum State {
6059
Unset,
6160
/// The attribute is set to the given value, which followed the `=` sign.
6261
/// Note that values can be empty.
63-
Value(CompactString), // TODO: use `kstring`, maybe it gets a binary string soon, needs binary, too, no UTF8 is required for attr values
62+
Value(BString), // TODO(performance): Is there a non-utf8 compact_str/KBString crate? See https://github.com/cobalt-org/kstring/issues/37#issuecomment-1446777265 .
6463
/// The attribute isn't mentioned with a given path or is explicitly set to `Unspecified` using the `!` sign.
6564
Unspecified,
6665
}
6766

6867
/// Represents a validated attribute name
6968
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
7069
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
71-
pub struct Name(pub(crate) CompactString);
70+
pub struct Name(pub(crate) String); // TODO(performance): See if `KBString` or `compact_string` could be meaningful here.
7271

7372
/// Holds a validated attribute name as a reference
7473
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd)]

gix-bitmap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ doctest = false
1313
test = true
1414

1515
[dependencies]
16-
quick-error = "2.0.0"
16+
thiserror = "1.0.38"
1717

1818
[dev-dependencies]
1919
gix-testtools = { path = "../tests/tools"}

gix-bitmap/src/ewah.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
use std::convert::TryInto;
22

33
pub mod decode {
4-
use quick_error::quick_error;
5-
6-
quick_error! {
7-
#[derive(Debug)]
8-
pub enum Error {
9-
Corrupt(message: &'static str) {
10-
display("{}", message)
11-
}
12-
}
4+
#[derive(Debug, thiserror::Error)]
5+
pub enum Error {
6+
#[error("{}", message)]
7+
Corrupt { message: &'static str },
138
}
149
}
1510

1611
pub fn decode(data: &[u8]) -> Result<(Vec, &[u8]), decode::Error> {
1712
use self::decode::Error;
1813
use crate::decode;
1914

20-
let (num_bits, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading amount of bits"))?;
21-
let (len, data) = decode::u32(data).ok_or(Error::Corrupt("eof reading chunk length"))?;
15+
let (num_bits, data) = decode::u32(data).ok_or(Error::Corrupt {
16+
message: "eof reading amount of bits",
17+
})?;
18+
let (len, data) = decode::u32(data).ok_or(Error::Corrupt {
19+
message: "eof reading chunk length",
20+
})?;
2221
let len = len as usize;
2322

2423
// NOTE: git does this by copying all bytes first, and then it will change the endianness in a separate loop.
2524
// Maybe it's faster, but we can't do it without unsafe. Let's leave it to the optimizer and maybe
2625
// one day somebody will find out that it's worth it to use unsafe here.
27-
let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>())
28-
.ok_or(Error::Corrupt("eof while reading bit data"))?;
26+
let (mut bits, data) = decode::split_at_pos(data, len * std::mem::size_of::<u64>()).ok_or(Error::Corrupt {
27+
message: "eof while reading bit data",
28+
})?;
2929
let mut buf = std::vec::Vec::<u64>::with_capacity(len);
3030
for _ in 0..len {
3131
let (bit_num, rest) = bits.split_at(std::mem::size_of::<u64>());
3232
bits = rest;
3333
buf.push(u64::from_be_bytes(bit_num.try_into().unwrap()))
3434
}
3535

36-
let (rlw, data) = decode::u32(data).ok_or(Error::Corrupt("eof while reading run length width"))?;
36+
let (rlw, data) = decode::u32(data).ok_or(Error::Corrupt {
37+
message: "eof while reading run length width",
38+
})?;
3739

3840
Ok((
3941
Vec {

gix-bitmap/src/lib.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,6 @@ pub mod ewah;
1010
pub(crate) mod decode {
1111
use std::convert::TryInto;
1212

13-
use quick_error::quick_error;
14-
15-
quick_error! {
16-
#[derive(Debug)]
17-
pub enum Error {
18-
Corrupt(message: &'static str) {
19-
display("{}", message)
20-
}
21-
}
22-
}
23-
2413
#[inline]
2514
pub(crate) fn split_at_pos(data: &[u8], pos: usize) -> Option<(&[u8], &[u8])> {
2615
if data.len() < pos {

0 commit comments

Comments
 (0)