- add a trailing "." to ABOUT for consistency
- rename OPT_FILES => ARG_FILES
- move to alphabetical order for OPTIONs (where reasonable)
Co-authored-by: Roy Ivy III <rivy.dev@gmail.com>
If the output of sort is piped to another program that closes the file
descriptor, sort currently panics. The GNU coreutils is able to handle
this case.
Replacing panic with crash_if_err reports the closed pipe and exits
with a return code, which seems like the correct behavior. Tested on
my Mac and the panic disappears.
Add a test which pipes data to sort - it won't protect against this
specific regression, but it increases the test coverage, at least.
Fixes#1608.
* factor: Introduce a type alias for exponents
This way, we can easily replace u8 with a larger type when moving to support
larger integers.
* factor::Factors: Split off a Decomposition type
The new type can be used to represent in-progress factorisations,
which contain non-prime factors.
* factor::Decomposition: Use a flat vector representation
~18% faster than BTreeMap, and ~5% faster than “master”.
* factor::Factors: Use a RefCell rather than copy data when printing
~2.9% faster than the previous commit, ~11% faster than “master” overall.
* CI: Only run rustfmt in one environment
- This displays clippy warnings even when rustfmt fails.
- This avoids displaying 3 copies of the same rustfmt warning as Github
annotations.
- Avoids duplicated work.
* CI: Suppress warnings when building for the oldest toolchain version
We had cases of warnings emitted due to `rustc` bugs that were fixed
in non-obsolete versions.
* factor: Remove a workaround for warnings on obsolete rustc
* factor::numeric::gcd: Switch variable names to be more consistent
* factor::numeric::gcd: Improve comments
* factor::numeric::gcd: Extend loop invariant to v
* factor::Factors: Derive implementations of Eq and PartialEq
* factors::Factors: Implement quickcheck::Arbitrary
This generates uniformly-distributed integers with known factorisations,
and will enable further testing.
* factor: Test against random numbers with known factorisations
* factor::Factors::arbitrary: Simplify method signature
* factor::numeric::gcd: Rename test against the Euclidean algorithm
* factor::numeric::gcd: Add various property-based tests
* factor::numeric::modular_inverse: Rename test
* factor::numeric::modular_inverse: Add test on random values
* factor::numeric: Start refactoring into multiple submodules
No change to the module's interface, but it should make it much easier to
keep the tests right next to the code they are related to.
Moreover, build.rs' dependency is now limited to numeric::{modular_inverse,
traits}, meaning that the rest of it can use build-time generated tables etc.
* factor::numeric: Move gcd (and its test) to a submodule
* factor::numeric: Move Montgomery arithmetic to its own module
Finally hollowed-out numeric.rs
* factor: Move numeric.rs to numeric/mod.rs
* factor::numeric: Fix an erroneous lint on obsolete Rust versions