Skip to content

Move the run-length encoding under a feature#356

Draft
Kerollmops wants to merge 1 commit into
mainfrom
no-run-length-encoding
Draft

Move the run-length encoding under a feature#356
Kerollmops wants to merge 1 commit into
mainfrom
no-run-length-encoding

Conversation

@Kerollmops

Copy link
Copy Markdown
Member

I propose introducing a new feature to disable run-length encoding in certain cases. It is enabled by default. I am wondering about the naming now, as I find run-length-serialization a bit long and ugly.

@lucascool12

Copy link
Copy Markdown
Contributor

Wouldn't it be better to add a new method that serializes without run-length encodings? Using features to enable or disable makes it impossible to choose this at runtime, which I see no real reason to not allow.

@Kerollmops

Copy link
Copy Markdown
Member Author

Hey @lucascool12 👋

You are right, I think it would be better to have a serialization_with_options method. What do you think? The options would be a struct with different fields, and the first one would be a simple run_length_encoding boolean.

Thanks for the help and have a nice day 🌵

@lucascool12

Copy link
Copy Markdown
Contributor

You are right, I think it would be better to have a serialization_with_options method. What do you think? The options would be a struct with different fields, and the first one would be a simple run_length_encoding boolean.

That seems like the best approach. I'm not sure what the best way to make this struct backward compatible is. I first thought a normal struct with #[non_exhaustive] would be a good idea, but after some light reading of https://doc.rust-lang.org/reference/attributes/type_system.html#r-attributes.type-system.non_exhaustive I no longer think this is a good idea. Maybe some builder like thing would work.

@Dr-Emann

Copy link
Copy Markdown
Member

Is there a reason calling remove_run_compression() before serializing isn't acceptable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants