The deleted tests/test1.rs didn't contain any additional tests and was
depending on an old `stream` feature. It should be covered by the
doctests of the used functions.
bitvec integration has caused some dependency issues, that were solved,
but still raises the minimum rust version significantly, which will be
problematic for some distributions like Debian.
The input traits implementations for bitvec types have been moved to the
nom-bitvec crate, so we can keep the functionality without affecting
basic nom usage
Use safe version of turning u32 into char because the input might
contain surrogates.
This only fixes a symptom and not the underlying issue that surrogates
are not handled at the moment.
If they didn't have enough input data, these two functions were
returning a `Needed` value reflecting the entire expected length, not
the length remaining after the available input.
As a result, a caller that blocks until the specified number of bytes
are available could get stuck waiting forever.
I've fixed the affected tests at the same time as fixing this bug. For
most of them I made sure the tests would detect this error. But for
`tests/overflow.rs`, I deleted the partial input after the length
instead (meaning the tests pass either way), because I don't think it
matters for the purposes of checking if the parsers have an unsigned
overflow.
The trait implementations permit `bitvec` types to be used directly
within the `bytes` parsers, as demonstrated by the `tests/bitstream`
module using `bytes::tag` to process a bitstream.
This unification allows the removal of the `bits` module in favor of
ordinary combinators written to be generic over a consumable input
type.
this parser trait reproduces the behaviour of previous nom functions,
and uses &mut self instead of &self to allow FnMut closures to be used
as parsers