Move the pin to Rust 1.98 - #26
Open
tamnd wants to merge 2 commits into
Open
Conversation
1.98 adds `clippy::chunks_exact_to_as_chunks`, and it fires four times
here. It is a good lint rather than a style note: `chunks_exact(8)`
hands back a slice whose length the compiler does not know, so every
one of these lines carried a `try_into().expect("eight bytes")` in the
middle of it to get an array back out. `as_chunks::<8>()` puts the
width in the type and the conversion and its panic go away.
Three of them are the widths in `Bytes::extend`, which is the copy out
of a column the engine filled into the buffer a typed array is made
from. The fourth is the flat edge list, where a pair is now a pair in
the type and `edge[0]` and `edge[1]` stop being indexes into something
that could be any length.
A remainder is the one thing that changes shape: `as_chunks` returns
it rather than dropping it. Both call sites want it dropped, and both
already do the right thing. `extend` is copying a column of whole
elements, so a partial one is a caller handing over something that is
not this column at all, which is what `chunks_exact` also ignored. The
edge list refuses an odd length by name before it gets here, so the
tail is provably empty.
The suite is unchanged at 363 tests, 354 passing and 9 skipped, and
the typed array round trips are what cover `extend` in both
directions.
The compiler is not chosen here. tamnd/zu's toolchains.toml holds one version for the nine repositories with Rust in them, and the toolchain file here is a copy of that row, so this follows tamnd/zu#515 rather than deciding anything. Two sites, the channel and rust-version. No workflow in this repository names a version: the clippy and test jobs read the toolchain file, which is the arrangement that keeps a bump from having to find every job that hardcoded a number. The libraries need nothing. napi 3.12.1, napi-derive 3.6.3, napi-build 2.4.1 and arrow 59.2.0 were checked against the registry on the same day and are all current. Verified on 1.98.0: `cargo fmt --check`, `cargo clippy --all-features -D warnings` clean now that the chunk sizes moved into the type, and `npm test` at 363 tests with nothing failing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25. Follows tamnd/zu#516, which moves the row in
toolchains.tomlthis repository copies.The pin itself is two lines, the channel and
rust-version. No workflow here names a version, since the clippy and test jobs read the toolchain file.The first commit is what makes the second one green. 1.98 ships
clippy::chunks_exact_to_as_chunks, which fires four times in this tree, so the pin bump would be a red CI without it. It is a good lint rather than a style note:chunks_exact(8)returns a slice whose length the compiler does not know, so each of those lines carried atry_into().expect("eight bytes")to get an array back out.as_chunks::<8>()puts the width in the type and both the conversion and its panic disappear. Three sites are the widths inBytes::extend, the copy out of an engine column into the buffer behind a typed array; the fourth is the flat edge list, where a pair becomes a pair in the type.as_chunksreturns the remainder thatchunks_exactdropped, and both call sites still want it dropped.extendcopies whole elements, so a partial one is a caller handing over something that is not this column. The edge list refuses an odd length by name before that line, so the tail is provably empty.Dependencies were checked against the registry the same day and are all on their newest series: napi 3.12.1, napi-derive 3.6.3, napi-build 2.4.1, arrow 59.2.0.
Verified on 1.98.0 locally:
cargo fmt --check,cargo clippy --all-features -- -D warningsclean,npm run build:debug, andnpm testat 363 tests, 354 passing, 9 skipped, none failing.