Skip to content

Commit 135d317

Browse files
committed
fix: compatibility with bstr v1.3, use *.as_bytes() instead of .as_ref().
`as_ref()` relies on a known target type which isn't always present. However, once there is only one implementation, that's no problem, but when that changes compilation fails due to ambiguity.
1 parent c56d336 commit 135d317

File tree

43 files changed

+63
-53
lines changed

Some content is hidden

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

43 files changed

+63
-53
lines changed

gix-actor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gix-date = { version = "^0.4.2", path = "../gix-date" }
2222

2323
quick-error = "2.0.0"
2424
btoi = "0.4.2"
25-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"]}
25+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
2626
nom = { version = "7", default-features = false, features = ["std"]}
2727
itoa = "1.0.1"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}

gix-attributes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gix-path = { version = "^0.7.1", path = "../gix-path" }
2222
gix-quote = { version = "^0.4.1", path = "../gix-quote" }
2323
gix-glob = { version = "^0.5.4", path = "../gix-glob" }
2424

25-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"]}
25+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
2626
unicode-bom = "1.1.4"
2727
thiserror = "1.0.26"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}

gix-command/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rust-version = "1.64"
1212
doctest = false
1313

1414
[dependencies]
15-
bstr = "1.0.1"
15+
bstr = "1.3.0"
1616

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

gix-commitgraph/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ gix-features = { version = "^0.26.4", path = "../gix-features", features = ["rus
2222
gix-hash = { version = "^0.10.2", path = "../gix-hash" }
2323
gix-chunk = { version = "^0.4.1", path = "../gix-chunk" }
2424

25-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
25+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
2626
memmap2 = "0.5.0"
2727
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
2828
thiserror = "1.0.26"

gix-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ nom = { version = "7", default_features = false, features = [ "std" ] }
2828
memchr = "2"
2929
thiserror = "1.0.26"
3030
unicode-bom = "1.1.4"
31-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
31+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
3232
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
3333
smallvec = "1.9.0"
3434
once_cell = "1.14.0"

gix-config/src/file/access/read_only.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{borrow::Cow, convert::TryFrom};
22

3-
use bstr::BStr;
3+
use bstr::{BStr, ByteSlice};
44
use gix_features::threading::OwnShared;
55
use smallvec::SmallVec;
66

@@ -348,6 +348,6 @@ impl<'event> File<'event> {
348348
}
349349

350350
pub(crate) fn detect_newline_style_smallvec(&self) -> SmallVec<[u8; 2]> {
351-
self.detect_newline_style().as_ref().into()
351+
self.detect_newline_style().as_bytes().into()
352352
}
353353
}

gix-config/src/file/init/from_env.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::convert::TryFrom;
22

3-
use bstr::BStr;
3+
use bstr::{BStr, ByteSlice};
44

55
use crate::{file, file::init, parse, parse::section, path::interpolate, File};
66

@@ -75,7 +75,7 @@ impl File<'static> {
7575
index: i,
7676
kind: "value",
7777
})?
78-
.as_ref()
78+
.as_bytes()
7979
.into(),
8080
),
8181
);

gix-config/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ serial_test = "1.0.0"
3232
serde_derive = "1.0"
3333
criterion = "0.4.0"
3434
tempfile = "3.2.0"
35-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
35+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
3636

3737
[package.metadata.docs.rs]
3838
all-features = true

gix-credentials/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gix-prompt = { version = "^0.3.2", path = "../gix-prompt" }
2525

2626
thiserror = "1.0.32"
2727
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
28-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
28+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
2929

3030

3131

gix-date/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ doctest = false
1717
serde1 = ["serde", "bstr/serde"]
1818

1919
[dependencies]
20-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
20+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
2121
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2222
itoa = "1.0.1"
2323
time = { version = "0.3.17", default-features = false, features = ["local-offset", "formatting", "macros", "parsing"] }

gix-discover/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ gix-path = { version = "^0.7.1", path = "../gix-path" }
1818
gix-ref = { version = "^0.24.0", path = "../gix-ref" }
1919
gix-hash = { version = "^0.10.2", path = "../gix-hash" }
2020

21-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"] }
21+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
2222
thiserror = "1.0.26"
2323

2424
[target.'cfg(windows)'.dependencies]

gix-features/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ document-features = { version = "0.2.0", optional = true }
136136
libc = { version = "0.2.119" }
137137

138138
[dev-dependencies]
139-
bstr = { version = "1.0.1", default-features = false }
139+
bstr = { version = "1.3.0", default-features = false }
140140

141141

142142
# Assembly doesn't yet compile on MSVC on windows, but does on GNU, see https://github.com/RustCrypto/asm-hashes/issues/17

gix-glob/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ doctest = false
1616
serde1 = ["serde", "bstr/serde"]
1717

1818
[dependencies]
19-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
19+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
2020
bitflags = "1.3.2"
2121
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2222

gix-index/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ gix-lock = { version = "^3.0.0", path = "../gix-lock" }
3030
thiserror = "1.0.32"
3131
memmap2 = "0.5.0"
3232
filetime = "0.2.15"
33-
bstr = { version = "1.0.1", default-features = false }
33+
bstr = { version = "1.3.0", default-features = false }
3434

3535
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
3636
smallvec = "1.7.0"

gix-index/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ gix-testtools = { path = "../../tests/tools"}
3636
gix = { path = "../../gix"}
3737
gix-hash = { path = "../../gix-hash"}
3838
filetime = "0.2.15"
39-
bstr = { version = "1.0.1", default-features = false }
39+
bstr = { version = "1.3.0", default-features = false }
4040

4141
[package.metadata.docs.rs]
4242
features = ["document-features", "serde1"]

gix-mailmap/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ serde1 = ["serde", "bstr/serde", "gix-actor/serde1"]
1717

1818
[dependencies]
1919
gix-actor = { version = "^0.17.1", path = "../gix-actor" }
20-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"]}
20+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"]}
2121
quick-error = "2.0.0"
2222
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
2323

gix-object/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ btoi = "0.4.2"
3131
itoa = "1.0.1"
3232
thiserror = "1.0.34"
3333
hex = "0.4.2"
34-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"] }
34+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
3535
nom = { version = "7", default-features = false, features = ["std"]}
3636
smallvec = { version = "1.4.0", features = ["write"] }
3737
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}

gix-pack/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ gix-features = { version = "^0.26.1", path = "../../gix-features" }
4040
gix-testtools = { path = "../../tests/tools"}
4141
gix-odb = { path = "../../gix-odb" }
4242
tempfile = "3.1.0"
43-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
43+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
4444
maplit = "1.0.2"
4545
gix-object = { path = "../../gix-object" }
4646
gix-traverse = { path = "../../gix-traverse" }

gix-packetline/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ required-features = ["blocking-io", "maybe-async/is_sync"]
4242
serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"]}
4343
thiserror = "1.0.34"
4444
hex = "0.4.2"
45-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
45+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
4646
# async support
4747
futures-io = { version = "0.3.16", optional = true }
4848
futures-lite = { version = "1.12.0", optional = true }

gix-path/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rust-version = "1.64"
1313
doctest = false
1414

1515
[dependencies]
16-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
16+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
1717
thiserror = "1.0.26"
1818

1919
[dev-dependencies]

gix-pathspec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ doctest = false
1515
gix-glob = { version = "^0.5.4", path = "../gix-glob" }
1616
gix-attributes = { version = "^0.8.2", path = "../gix-attributes" }
1717

18-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
18+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
1919
bitflags = "1.3.2"
2020
thiserror = "1.0.26"
2121

gix-protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ gix-credentials = { version = "^0.9.1", path = "../gix-credentials" }
4747

4848
thiserror = "1.0.32"
4949
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
50-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"] }
50+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
5151
nom = { version = "7", default-features = false, features = ["std"]}
5252
btoi = "0.4.2"
5353

gix-quote/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ rust-version = "1.64"
1212
doctest = false
1313

1414
[dependencies]
15-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
15+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
1616
quick-error = "2.0.0"
1717
btoi = "0.4.2"

gix-ref/src/fullname.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ impl FullNameRef {
106106
pub fn category_and_short_name(&self) -> Option<(Category<'_>, &BStr)> {
107107
let name = self.0.as_bstr();
108108
for category in &[Category::Tag, Category::LocalBranch, Category::RemoteBranch] {
109-
if let Some(shortened) = name.strip_prefix(category.prefix().as_ref()) {
109+
if let Some(shortened) = name.strip_prefix(category.prefix().as_bytes()) {
110110
return Some((*category, shortened.as_bstr()));
111111
}
112112
}
@@ -129,14 +129,14 @@ impl FullNameRef {
129129

130130
if is_pseudo_ref(name) {
131131
Some((Category::PseudoRef, name))
132-
} else if let Some(shortened) = name.strip_prefix(Category::MainPseudoRef.prefix().as_ref()) {
132+
} else if let Some(shortened) = name.strip_prefix(Category::MainPseudoRef.prefix().as_bytes()) {
133133
if shortened.starts_with_str("refs/") {
134134
(Category::MainRef, shortened.as_bstr()).into()
135135
} else {
136136
is_pseudo_ref(shortened).then(|| (Category::MainPseudoRef, shortened.as_bstr()))
137137
}
138138
} else if let Some(shortened_with_worktree_name) =
139-
name.strip_prefix(Category::LinkedPseudoRef { name: "".into() }.prefix().as_ref())
139+
name.strip_prefix(Category::LinkedPseudoRef { name: "".into() }.prefix().as_bytes())
140140
{
141141
let (name, shortened) = shortened_with_worktree_name.find_byte(b'/').map(|pos| {
142142
(

gix-ref/src/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mod access {
7373
self.name
7474
.0
7575
.as_bstr()
76-
.strip_prefix(namespace.0.as_bstr().as_ref())
76+
.strip_prefix(namespace.0.as_bytes())
7777
.map(|stripped| FullNameRef::new_unchecked(stripped.as_bstr()))
7878
}
7979

gix-ref/src/store/packed/find.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl packed::Buffer {
9292
let ofs = b as *const u8 as usize - a.as_ptr() as usize;
9393
let line = &a[search_start_of_record(ofs)..];
9494
packed::decode::reference::<()>(line)
95-
.map(|(_rest, r)| r.name.as_bstr().as_ref())
95+
.map(|(_rest, r)| r.name.as_bstr().as_bytes())
9696
.map_err(|err| {
9797
encountered_parse_failure = true;
9898
err

gix-refspec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ gix-revision = { version = "^0.10.3", path = "../gix-revision" }
1717
gix-validate = { version = "^0.7.2", path = "../gix-validate" }
1818
gix-hash = { version = "^0.10.2", path = "../gix-hash" }
1919

20-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
20+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
2121
thiserror = "1.0.26"
2222
smallvec = "1.9.0"
2323

gix-revision/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gix-object = { version = "^0.26.1", path = "../gix-object" }
2323
gix-date = { version = "^0.4.2", path = "../gix-date" }
2424
gix-hashtable = { version = "^0.1.1", path = "../gix-hashtable" }
2525

26-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
26+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}
2727
thiserror = "1.0.26"
2828
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }
2929
document-features = { version = "0.2.1", optional = true }

gix-revision/src/spec/parse/function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ where
322322
fn consume_all(res: Option<()>) -> Result<&'static BStr, Error> {
323323
res.ok_or(Error::Delegate).map(|_| "".into())
324324
}
325-
match input.as_ref() {
325+
match input.as_bytes() {
326326
[b':'] => return Err(Error::MissingColonSuffix),
327327
[b':', b'/'] => return Err(Error::EmptyTopLevelRegex),
328328
[b':', b'/', regex @ ..] => {
@@ -532,7 +532,7 @@ where
532532
past_sep.and_then(|past_sep| parens(past_sep).transpose()).transpose()?
533533
{
534534
cursor += consumed;
535-
let target = match kind.as_ref().as_ref() {
535+
let target = match kind.as_ref().as_bytes() {
536536
b"commit" => delegate::PeelTo::ObjectKind(gix_object::Kind::Commit),
537537
b"tag" => delegate::PeelTo::ObjectKind(gix_object::Kind::Tag),
538538
b"tree" => delegate::PeelTo::ObjectKind(gix_object::Kind::Tree),

gix-revision/tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ gix-object = { path = "../../gix-object" }
2626
gix-testtools = { path = "../../tests/tools" }
2727
gix = { path = "../../gix", default-features = false }
2828

29-
bstr = { version = "1.0.1", default-features = false, features = ["std"]}
29+
bstr = { version = "1.3.0", default-features = false, features = ["std"]}

gix-transport/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ gix-credentials = { version = "^0.9.1", path = "../gix-credentials", optional =
6262
gix-quote = { version = "^0.4.1", path = "../gix-quote" }
6363

6464
serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"]}
65-
bstr = { version = "1.0.1", default-features = false, features = ["std", "unicode"] }
65+
bstr = { version = "1.3.0", default-features = false, features = ["std", "unicode"] }
6666
thiserror = "1.0.26"
6767

6868
# for async-client

gix-url/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ gix-path = { version = "^0.7.1", path = "../gix-path" }
2323
serde = { version = "1.0.114", optional = true, default-features = false, features = ["std", "derive"]}
2424
thiserror = "1.0.32"
2525
url = "2.1.1"
26-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
26+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
2727
home = "0.5.3"
2828

2929
document-features = { version = "0.2.0", optional = true }

gix-validate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test = true
1515

1616
[dependencies]
1717
thiserror = "1.0.34"
18-
bstr = { version = "1.0.1", default-features = false, features = ["std"] }
18+
bstr = { version = "1.3.0", default-features = false, features = ["std"] }
1919

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

gix-worktree/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ gix-features = { version = "^0.26.4", path = "../gix-features" }
4141
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}
4242

4343
thiserror = "1.0.26"
44-
bstr = { version = "1.0.1", default-features = false }
44+
bstr = { version = "1.3.0", default-features = false }
4545

4646
document-features = { version = "0.2.0", optional = true }
4747
io-close = "0.3.7"

gix-worktree/src/fs/cache/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Ignore {
114114
groups
115115
.iter()
116116
.rev()
117-
.find_map(|group| group.pattern_matching_relative_path(relative_path.as_ref(), is_dir, case))
117+
.find_map(|group| group.pattern_matching_relative_path(relative_path.as_bytes(), is_dir, case))
118118
.or(dir_match)
119119
}
120120

gix-worktree/tests/worktree/fs/cache/ignore_and_attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn special_exclude_cases_we_handle_differently() {
7575
let match_ = platform.matching_exclude_pattern().expect("match all values");
7676
let is_excluded = platform.is_excluded();
7777

78-
match relative_entry.as_ref() {
78+
match relative_entry.as_bytes() {
7979
b"tld" | b"tld/" | b"tld/file" | b"tld/sd" | b"tld/sd/" => {
8080
assert_eq!(match_.pattern.to_string(), "tld/");
8181
}

gix/src/config/tree/sections/core.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ pub type Disambiguate = keys::Any<validate::Disambiguate>;
111111
mod disambiguate {
112112
use std::borrow::Cow;
113113

114+
use crate::bstr::ByteSlice;
114115
use crate::{bstr::BStr, config, config::tree::core::Disambiguate, revision::spec::parse::ObjectKindHint};
115116

116117
impl Disambiguate {
@@ -119,7 +120,7 @@ mod disambiguate {
119120
&'static self,
120121
value: Cow<'_, BStr>,
121122
) -> Result<Option<ObjectKindHint>, config::key::GenericErrorWithValue> {
122-
let hint = match value.as_ref().as_ref() {
123+
let hint = match value.as_ref().as_bytes() {
123124
b"none" => return Ok(None),
124125
b"commit" => ObjectKindHint::Commit,
125126
b"committish" => ObjectKindHint::Committish,
@@ -166,6 +167,7 @@ mod log_all_ref_updates {
166167
mod check_stat {
167168
use std::borrow::Cow;
168169

170+
use crate::bstr::ByteSlice;
169171
use crate::{bstr::BStr, config, config::tree::core::CheckStat};
170172

171173
impl CheckStat {
@@ -174,7 +176,7 @@ mod check_stat {
174176
&'static self,
175177
value: Cow<'_, BStr>,
176178
) -> Result<bool, config::key::GenericErrorWithValue> {
177-
Ok(match value.as_ref().as_ref() {
179+
Ok(match value.as_ref().as_bytes() {
178180
b"minimal" => false,
179181
b"default" => true,
180182
_ => {

0 commit comments

Comments
 (0)