Skip to content

percent_encoding::EncodeSet cannot be boxed #388

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
dead10ck opened this issue Aug 11, 2017 · 0 comments · Fixed by #519
Closed

percent_encoding::EncodeSet cannot be boxed #388

dead10ck opened this issue Aug 11, 2017 · 0 comments · Fixed by #519

Comments

@dead10ck
Copy link

EncodeSet implements Clone, which in turn implements Sized. This has the unfortunate consequence that it becomes impossible to create trait objects of type Box<EncodeSet>; an attempt to do so results in a compiler error with a message that says the trait ``percent_encoding::EncodeSet`` cannot be made into an object. This makes it very difficult to choose an EncodeSet dynamically at runtime in an efficient manner.

SimonSapin added a commit that referenced this issue Jul 17, 2019
bors-servo pushed a commit that referenced this issue Jul 17, 2019
percent-encoding: make sets be values of one type, instead of types that implement a trait

Fix #388

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/519)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this issue Jul 17, 2019
percent-encoding: make sets be values of one type, instead of types that implement a trait

Fix #388

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-url/519)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant