Closed DrChat closed 10 months ago
As an aside, for the errors I'd urge you to consider making them opaque to our callers using something like the following:
enum ErrorRepr {
OddLength,
OverreadBlock,
// ....
}
/// Implements std::error::Error, Display, etc...
pub struct Error(Box<ErrorRepr>);
Generally, most callers don't really care why decoding failed apart from knowing that it did fail. So this allows us much more flexibility in capturing relevant context information in errors as well as changing the representation without breaking SemVer.
Length trees are allowed to be empty (zero maximum path length).
Reference (in addition to
BUILD_TABLE_MAYBE_EMPTY
): https://github.com/kyz/libmspack/blob/305907723a4e7ab2018e58 40059ffb5e77db837/libmspack/mspack/lzxd.c#L555-L558