Skip to content

Commit 38988e2

Browse files
authored
Merge branch 'main' into kdy1/update-cargo-mono
2 parents 0586ea2 + f9ff0d8 commit 38988e2

6 files changed

Lines changed: 38 additions & 159 deletions

File tree

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v4
5353

54-
- uses: EmbarkStudios/cargo-deny-action@v1
54+
- uses: EmbarkStudios/cargo-deny-action@v2
5555

5656
cargo-check:
5757
name: Check

Cargo.lock

Lines changed: 9 additions & 124 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
@@ -38,12 +38,12 @@ once_cell = "1.21.3"
3838
phf = "0.11.3"
3939
proc-macro2 = "1.0.94"
4040
quote = "1.0.40"
41-
rand = "0.8.5"
41+
rand = "0.8.6"
4242
rand_xorshift = "0.3"
4343
rayon = "1.10.0"
4444
regex = "1.11.1"
4545
reqwest = "0.12.15"
46-
rkyv = "0.8.10"
46+
rkyv = { version = "0.8.16", default-features = false, features = ["bytecheck"] }
4747
rustc-hash = "2.1.1"
4848
schemars = "0.8.22"
4949
scoped-tls = "1"
@@ -60,5 +60,5 @@ tracing = "0.1.41"
6060
tracing-subscriber = "0.3.19"
6161
triomphe = "0.1.14"
6262
url = "2.5.4"
63-
bytes = "1.10.1"
63+
bytes = "1.11.1"
6464
ascii = "1.1.0"

crates/bytes-str/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
66
license = { workspace = true }
77
name = "bytes-str"
88
repository = { workspace = true }
9-
version = "0.2.7"
9+
version = "0.2.8"
1010

1111
[features]
1212
rkyv = ["dep:rkyv", "rkyv/bytes-1"]

crates/bytes-str/src/byte_string.rs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@ impl BytesString {
123123
/// Splits the string into two at the given index.
124124
///
125125
/// Returns a newly allocated String. `self` contains bytes at indices
126-
/// greater than `at`, and the returned string contains bytes at indices
127-
/// less than `at`.
126+
/// less than `at`, and the returned string contains bytes at indices
127+
/// greater than or equal to `at`.
128+
///
129+
/// # Panics
130+
///
131+
/// Panics if `at` does not lie on a char boundary.
128132
///
129133
/// # Examples
130134
///
@@ -139,6 +143,8 @@ impl BytesString {
139143
/// assert_eq!(other, "llo");
140144
/// ```
141145
pub fn split_off(&mut self, at: usize) -> Self {
146+
assert!(self.is_char_boundary(at));
147+
142148
Self {
143149
bytes: self.bytes.split_off(at),
144150
}
@@ -940,6 +946,19 @@ mod tests {
940946
let other = s.split_off(5);
941947
assert_eq!(s.as_str(), "hello");
942948
assert_eq!(other.as_str(), "");
949+
950+
// Test unicode boundaries
951+
let mut s = BytesString::from("한국어");
952+
let other = s.split_off(6);
953+
assert_eq!(s.as_str(), "한국");
954+
assert_eq!(other.as_str(), "어");
955+
}
956+
957+
#[test]
958+
#[should_panic]
959+
fn test_split_off_panic_on_char_boundary() {
960+
let mut s = BytesString::from("é");
961+
s.split_off(1); // Should panic as it's not on a char boundary
943962
}
944963

945964
#[test]

deny.toml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# The values provided in this template are the default values that will be used
1010
# when any section or field is not specified in your own configuration
1111

12+
[graph]
1213
# If 1 or more target triples (and optionally, target_features) are specified,
1314
# only the specified targets will be checked when running `cargo deny check`.
1415
# This means, if a particular package is only ever used as a target specific
@@ -27,16 +28,10 @@ targets = []
2728
db-path = "~/.cargo/advisory-db"
2829
# The url(s) of the advisory databases to use
2930
db-urls = ["https://github.com/rustsec/advisory-db"]
30-
# The lint level for security vulnerabilities
31-
vulnerability = "deny"
32-
# The lint level for unmaintained crates
33-
unmaintained = "warn"
31+
# Whether unmaintained advisories should fail the check
32+
unmaintained = "none"
3433
# The lint level for crates that have been yanked from their source registry
3534
yanked = "warn"
36-
# The lint level for crates with security notices. Note that as of
37-
# 2019-12-17 there are no security notice advisories in
38-
# https://github.com/rustsec/advisory-db
39-
notice = "warn"
4035
# A list of advisory IDs to ignore. Note that ignored advisories will still
4136
# output a note when they are encountered.
4237
ignore = [
@@ -58,8 +53,6 @@ ignore = [
5853
# More documentation for the licenses section can be found here:
5954
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
6055
[licenses]
61-
# The lint level for crates which do not have a detectable license
62-
unlicensed = "deny"
6356
# List of explictly allowed licenses
6457
# See https://spdx.org/licenses/ for list of possible licenses
6558
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
@@ -75,24 +68,6 @@ allow = [
7568
"Unicode-DFS-2016",
7669
"Unicode-3.0",
7770
]
78-
# List of explictly disallowed licenses
79-
# See https://spdx.org/licenses/ for list of possible licenses
80-
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
81-
deny = []
82-
# Lint level for licenses considered copyleft
83-
copyleft = "deny"
84-
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
85-
# * both - The license will be approved if it is both OSI-approved *AND* FSF
86-
# * either - The license will be approved if it is either OSI-approved *OR* FSF
87-
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
88-
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
89-
# * neither - This predicate is ignored and the default lint level is used
90-
allow-osi-fsf-free = "neither"
91-
# Lint level used when no other predicates are matched
92-
# 1. License isn't in the allow or deny lists
93-
# 2. License isn't copyleft
94-
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
95-
default = "deny"
9671
# The confidence threshold for detecting a license from license text.
9772
# The higher the value, the more closely the license text must be to the
9873
# canonical license text of a valid SPDX license file.

0 commit comments

Comments
 (0)