alexcrichton / alexcrichton/xz2-rs

No way to fetch values from `LzmaOptions` struct

Ouverte
#71 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Rust
Étoiles
93
Forks
67
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi! I'm currently working on porting a C program using liblzma over to Rust, and I'm using this library as a substitute for raw unsafe bindings, so thank you for your work on it.

Unfortunately I've encountered two issues thus far - neither of which are major, but make the porting process more difficult than it needs to be.

The first is simply that liblzma has `LZMA_VLI_UNKNOWN`, but I can't find a related value or setting in `xz2`. I suspect this is just a lack of understanding on my part or something I've missed, but I'd appreciate some clarification as to where I can set the Variable-Length Integer setting to Unknown in this lib. I haven't seen any VLI options, but I also haven't seen any documentation on the matter.

The second is that the program I'm working with basically just initializes the LZMA options with a preset value (0-9) and after loading the preset, queries the dictionary size on said options for use in other things (since this is set within liblzma by the preset itself, the only access I have to `dict_size` is this way).

Would it be possible and/or reasonable to expose option values through `xz2` in case of situations such as these? The library has the `dict_size` method already, so I suspect it shouldn't be unreasonable to expect access to a variable one can set. My only alternative as a user of the library is to create some kind of reference table mapping preset to dict size, but that's clunky and leaves room for future bugs on LZMA version changes.

If this is a simple enough change I would be open to doing a PR for it myself, but I wanted to ask first in case there's something I'm missing or a specific reason why it isn't included.

Thank you again for your work on the library and your time,
Z

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.