utopia-ia/elffuss-braid public
Changesets · Branches · Tags · Compare
| Changeset | 7b35ddcb3f64cb55714e81d45b6fc77a54ef207cacf268b0c660a5b76c554cb7 |
|---|---|
| Author | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-16 17:00 +02:00 |
| Committer | KikoCis <KikoCis@users.noreply.github.com> · 2026-10-16 17:00 +02:00 |
| Parents | 2a0e4dd55cbb |
6 files changed
modified .github/workflows/ci.yml +7 −5
| @@ -12,6 +12,8 @@ | ||
| 12 | 12 | CARGO_TERM_COLOR: always |
| 13 | 13 | RUSTFLAGS: -D warnings |
| 14 | 14 | |
| 15 | +# The toolchain is pinned so that a new stable release, with new lints, | |
| 16 | +# never breaks the build by surprise: bump it on purpose. | |
| 15 | 17 | jobs: |
| 16 | 18 | test: |
| 17 | 19 | name: test (${{ matrix.os }}) |
| @@ -26,7 +28,7 @@ | ||
| 26 | 28 | # The git bridge round-trips this repository's own history, which a |
| 27 | 29 | # shallow checkout does not have. |
| 28 | 30 | fetch-depth: 0 |
| 29 | - - uses: dtolnay/rust-toolchain@stable | |
| 31 | + - uses: dtolnay/rust-toolchain@1.99.0 | |
| 30 | 32 | with: |
| 31 | 33 | components: rustfmt, clippy |
| 32 | 34 | - uses: Swatinem/rust-cache@v2 |
| @@ -48,7 +50,7 @@ | ||
| 48 | 50 | runs-on: ubuntu-latest |
| 49 | 51 | steps: |
| 50 | 52 | - uses: actions/checkout@v5 |
| 51 | - - uses: dtolnay/rust-toolchain@stable | |
| 53 | + - uses: dtolnay/rust-toolchain@1.99.0 | |
| 52 | 54 | with: |
| 53 | 55 | targets: wasm32-unknown-unknown |
| 54 | 56 | - run: cargo check -p elffuss-braid-format -p elffuss-braid-engine --target wasm32-unknown-unknown --locked |
| @@ -68,7 +70,7 @@ | ||
| 68 | 70 | with: |
| 69 | 71 | # The quick import scenario reads this repository's own history. |
| 70 | 72 | fetch-depth: 0 |
| 71 | - - uses: dtolnay/rust-toolchain@stable | |
| 73 | + - uses: dtolnay/rust-toolchain@1.99.0 | |
| 72 | 74 | - uses: Swatinem/rust-cache@v2 |
| 73 | 75 | # Small inputs, only to keep the suite working: the ratios of a quick |
| 74 | 76 | # run mean nothing, and its results stay on the runner, unpublished. |
| @@ -88,7 +90,7 @@ | ||
| 88 | 90 | runs-on: ubuntu-latest |
| 89 | 91 | steps: |
| 90 | 92 | - uses: actions/checkout@v5 |
| 91 | - - uses: dtolnay/rust-toolchain@stable | |
| 93 | + - uses: dtolnay/rust-toolchain@1.99.0 | |
| 92 | 94 | - uses: Swatinem/rust-cache@v2 |
| 93 | 95 | - run: cargo install b3sum --locked |
| 94 | 96 | - run: python3 docs/spec/check_vectors.py |
| @@ -106,5 +108,5 @@ | ||
| 106 | 108 | working-directory: fuzz |
| 107 | 109 | run: | |
| 108 | 110 | for target in decode_tree decode_changeset names git_map git_objects; do |
| 109 | - cargo fuzz run "$target" -- -max_total_time=60 | |
| 111 | + cargo fuzz run --target x86_64-unknown-linux-gnu "$target" -- -max_total_time=60 | |
| 110 | 112 | done |
modified crates/format/src/id.rs +4 −3
| @@ -189,9 +189,10 @@ | ||
| 189 | 189 | return Err(ParseIdError::Length(digits.len())); |
| 190 | 190 | } |
| 191 | 191 | let mut bytes = [0u8; 32]; |
| 192 | - for (i, pair) in digits.chunks_exact(2).enumerate() { | |
| 193 | - let high = hex_value(pair[0]).ok_or(ParseIdError::Digit(2 * i))?; | |
| 194 | - let low = hex_value(pair[1]).ok_or(ParseIdError::Digit(2 * i + 1))?; | |
| 192 | + let (pairs, _) = digits.as_chunks::<2>(); | |
| 193 | + for (i, [high, low]) in pairs.iter().enumerate() { | |
| 194 | + let high = hex_value(*high).ok_or(ParseIdError::Digit(2 * i))?; | |
| 195 | + let low = hex_value(*low).ok_or(ParseIdError::Digit(2 * i + 1))?; | |
| 195 | 196 | bytes[i] = (high << 4) | low; |
| 196 | 197 | } |
| 197 | 198 | Ok(Self(bytes)) |
modified crates/git/src/oid.rs +1 −1
| @@ -129,7 +129,7 @@ | ||
| 129 | 129 | return None; |
| 130 | 130 | } |
| 131 | 131 | let mut bytes = [0u8; 20]; |
| 132 | - for (byte, pair) in bytes.iter_mut().zip(digits.chunks_exact(2)) { | |
| 132 | + for (byte, pair) in bytes.iter_mut().zip(digits.as_chunks::<2>().0) { | |
| 133 | 133 | *byte = (hex_value(pair[0])? << 4) | hex_value(pair[1])?; |
| 134 | 134 | } |
| 135 | 135 | Some(Self(bytes)) |
modified crates/store/src/derived.rs +1 −1
| @@ -143,7 +143,7 @@ | ||
| 143 | 143 | } |
| 144 | 144 | let bytes = read_range(file, state.read_to, end - state.read_to) |
| 145 | 145 | .map_err(io_error("read", &self.path))?; |
| 146 | - for slot in bytes.chunks_exact(ENTRY_LEN as usize) { | |
| 146 | + for slot in bytes.as_chunks::<{ ENTRY_LEN as usize }>().0 { | |
| 147 | 147 | if let Some((key, id)) = decode(slot) { |
| 148 | 148 | state.map.insert(key, id); |
| 149 | 149 | } |
modified crates/store/src/index.rs +8 −6
| @@ -201,7 +201,7 @@ | ||
| 201 | 201 | } |
| 202 | 202 | let (table, fanout) = checked.split_at(COVERED_LEN * segments); |
| 203 | 203 | let mut covered = Vec::with_capacity(segments); |
| 204 | - for slot in table.chunks_exact(COVERED_LEN) { | |
| 204 | + for slot in table.as_chunks::<COVERED_LEN>().0 { | |
| 205 | 205 | let name = hex(&slot[..16]); |
| 206 | 206 | if covered.iter().any(|seen: &Covered| seen.name == name) { |
| 207 | 207 | return Err(Damaged("index names a segment twice")); |
| @@ -212,8 +212,10 @@ | ||
| 212 | 212 | }); |
| 213 | 213 | } |
| 214 | 214 | let fanout: Vec<u32> = fanout |
| 215 | - .chunks_exact(4) | |
| 216 | - .map(|value| u32::from_le_bytes(array(value))) | |
| 215 | + .as_chunks::<4>() | |
| 216 | + .0 | |
| 217 | + .iter() | |
| 218 | + .map(|value| u32::from_le_bytes(*value)) | |
| 217 | 219 | .collect(); |
| 218 | 220 | if fanout.windows(2).any(|pair| pair[0] > pair[1]) || u64::from(fanout[255]) != count { |
| 219 | 221 | return Err(Damaged( |
| @@ -235,7 +237,7 @@ | ||
| 235 | 237 | return Err(IndexError::Damaged("index bucket cut short")); |
| 236 | 238 | } |
| 237 | 239 | let mut entries: Vec<(Entry, u16)> = Vec::with_capacity(bytes.len() / ENTRY_LEN as usize); |
| 238 | - for slot in bytes.chunks_exact(ENTRY_LEN as usize) { | |
| 240 | + for slot in bytes.as_chunks::<{ ENTRY_LEN as usize }>().0 { | |
| 239 | 241 | let (entry, segment) = Entry::decode_in(slot).map_err(|unusable| match unusable { |
| 240 | 242 | Unusable::Invalid => IndexError::Damaged("index entry fails its checksum"), |
| 241 | 243 | Unusable::Newer => { |
| @@ -409,7 +411,7 @@ | ||
| 409 | 411 | } |
| 410 | 412 | |
| 411 | 413 | let mut below = 0usize; |
| 412 | - for (byte, value) in fanout.chunks_exact(4).enumerate() { | |
| 414 | + for (byte, value) in fanout.as_chunks::<4>().0.iter().enumerate() { | |
| 413 | 415 | below += entries[below..] |
| 414 | 416 | .iter() |
| 415 | 417 | .take_while(|entry| usize::from(entry.id.as_bytes()[0]) == byte) |
| @@ -440,7 +442,7 @@ | ||
| 440 | 442 | _ => b - b'a' + 10, |
| 441 | 443 | }; |
| 442 | 444 | let mut out = [0u8; 16]; |
| 443 | - for (slot, pair) in out.iter_mut().zip(name.as_bytes().chunks_exact(2)) { | |
| 445 | + for (slot, pair) in out.iter_mut().zip(name.as_bytes().as_chunks::<2>().0) { | |
| 444 | 446 | *slot = digit(pair[0]) << 4 | digit(pair[1]); |
| 445 | 447 | } |
| 446 | 448 | out |
modified crates/store/tests/versions.rs +2 −2
| @@ -297,10 +297,10 @@ | ||
| 297 | 297 | out.extend_from_slice(&(count as u64).to_le_bytes()); |
| 298 | 298 | out.extend_from_slice(segment_len); |
| 299 | 299 | out.extend_from_slice(fanout); |
| 300 | - for entry in entries.chunks_exact(64) { | |
| 300 | + for entry in entries.as_chunks::<64>().0 { | |
| 301 | 301 | out.extend_from_slice(&entry[..32]); |
| 302 | 302 | } |
| 303 | - for entry in entries.chunks_exact(64) { | |
| 303 | + for entry in entries.as_chunks::<64>().0 { | |
| 304 | 304 | out.extend_from_slice(&entry[32..60]); |
| 305 | 305 | out.extend_from_slice(&0u32.to_le_bytes()); |
| 306 | 306 | } |