Skip to content

Add Cargo feature query_encoding_2 to use encoding_rs crate #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

talklittle
Copy link

@talklittle talklittle commented Apr 5, 2018

Fixes #444


This change is Reviewable

@hsivonen
Copy link
Collaborator

hsivonen commented Apr 5, 2018

See my old PR on the same topic for a more copy-avoiding implementation of decode.

Applies when using `encoding_rs` via the `query_encoding_2` feature.

Code originally by @hsivonen in
servo#262
@talklittle
Copy link
Author

Thanks @hsivonen. I just copied your old Cow code, hope you don't mind.

@hsivonen
Copy link
Collaborator

hsivonen commented Apr 5, 2018

I don't mind. I pointed to it so that you'd copy it. Thanks.

@talklittle
Copy link
Author

talklittle commented Apr 5, 2018

Closing temporarily. I want to fix cargo build --all-features. I'll probably make the new crate override the legacy one if both feature flags are provided. [Edit: Nevermind, that doesn't make sense since the problem is when 2 libraries are building with conflicting feature flags. I'll have to make both sets of code usable.]

I don't think I'll go the trait approach, since IMO that seems like overkill when AFAIK there are no plans to make a third encoding crate. And if there were another encoding implementation, there's no guarantee it would fit nicely into the existing encoding API.

cc @SimonSapin

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.

2 participants