Following a discussion on Discord where their absence lead to combining
not-function conditions and truth tables. It's just easier to invert a
whole expression.
There's nothing wrong with Travis CI, but AppVeyor has started to fail
builds with a toolchain error when they install rustfmt. This is the
second time some kind of toolchain change has broken my builds, so I'm
migrating away from it.
I could have migrated to Travis CI's relatively new Windows support, but
that's still in the early adoption phase according to its own docs, and
I might as well instead move to GitHub's first-party offering. There's
no point then using Travis CI for Linux builds when that can be done on
GitHub Actions too.
It turns out that passing in one byte at a time is really inefficient
(which really should have been obvious...). For small files the
difference is insignificant, but for Skyrim SE's Update.esm (18 MB)
feeding in the buffered file content slice made the calculation twice
as fast, and this seems to have non-linear effect, as the benchmark
against Dragonborn.esm (63 MB) would have taken ~ 1137 seconds to run
when passing one byte at a time (the benchmark using a buffer took ~ 5
seconds).
On top of that, switching to the crc32fast crate has an insignificant
effect on benchmarking with Blank.esm, but Update.esm's benchmark
was twice as fast again, and when benchmarking with Dragonborn.esm,
using crc32fast was ~ 170x faster than using the crc crate!
rustfmt hasn't been a preview for a while now. It still needs to
be installed separately because Travis uses the minimal Rustup
profile, which doesn't include it. Also use the minimal profile on
Windows for consistency and to speed up installation.
Unfortunately the published binary no longer works on Travis
unless the build happens on its bionic image, because the binary is
built in GitHub Actions using the ubuntu:latest image. Running in bionic isn't
guaranteed not to break in the future, so install from source and cache
the artifact to be sure.
Fortunately, cargo install no longer requires --force to update an installed binary
crate, so building from source and caching the result is simpler
than it used to be.