Skip to content

Expand implementation of ToBytes for references to non-Sized types - #811

Open
Cerber-Ursi wants to merge 1 commit into
fede1024:masterfrom
Cerber-Ursi:tobytes-unsized-ref-impl
Open

Expand implementation of ToBytes for references to non-Sized types#811
Cerber-Ursi wants to merge 1 commit into
fede1024:masterfrom
Cerber-Ursi:tobytes-unsized-ref-impl

Conversation

@Cerber-Ursi

Copy link
Copy Markdown

Right now, ToBytes is implemented for references, but only when the referenced type is Sized. In particular, it's not implemented for &str, despite being implemented for str; therefore every place expecting &T where T: ToBytes, when passed &&str, can lead to somewhat cryptic errors.

This merge request relaxes requirements on impl ToBytes for &T and includes a simple unit test to ensure that this change actually removes the compilation error.

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.

1 participant