Skip to content
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

Impl Clone, PartialEq, Eq for Markup? #100

Closed
LukasKalbertodt opened this issue Aug 24, 2017 · 2 comments
Closed

Impl Clone, PartialEq, Eq for Markup? #100

LukasKalbertodt opened this issue Aug 24, 2017 · 2 comments

Comments

@LukasKalbertodt
Copy link
Contributor

Should be possible since it's just a string. Are there any reasons not to derive those traits?

@lambda-fairy
Copy link
Owner

lambda-fairy commented Aug 25, 2017

I agree with Clone, and would be happy to take a PR that adds #[derive(Copy, Clone)].

Not sure about PartialEq though. Semantically, a Markup object represents an HTML fragment, so it would also make sense to compare parse trees instead (e.g. PreEscaped("<br>") == PreEscaped("<br >")). Best to avoid this ambiguity and not implement the comparison traits.

@LukasKalbertodt
Copy link
Contributor Author

@lfairy Yeah, I guess you're right about Eq :)

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

No branches or pull requests

2 participants