Frommi / miniz_oxide

Rust replacement for miniz
MIT License
168 stars 48 forks source link

Is TINFL_FLAG_HAS_MORE_INPUT necessary? #86

Open Plecra opened 3 years ago

Plecra commented 3 years ago

https://github.com/Frommi/miniz_oxide/blob/7f5aedd7cc553b624902210a7d136440c138dc80/miniz_oxide/src/inflate/core.rs#L600-L607

It seems like the flag only serves to rename the NeedsMoreInput variant to FailedCannotMakeProgress at runtime. Both of the errors only seem to be created in this function. The API doesn't seem to do much but confuse users, so could it be removed? (NeedsMoreInput is a perfectly reasonable error state if the caller already knows there's no more input)

oyvindln commented 3 years ago

Not sure, will have to look into it, some of these flags are remnants from porting miniz from C.