Serialize impl and Display impl yields different case #323

Closed
opened 2018-09-21 09:14:39 -05:00 by Marwes · 3 comments
Marwes commented 2018-09-21 09:14:39 -05:00 (Migrated from github.com)

Describe the bug

By default Uuids gets serialized with lowercase but their fmt::Display writes the uuid in uppercase.

github.com/uuid-rs/uuid@10e1b423ae/src/serde_support.rs (L23)

github.com/uuid-rs/uuid@f414b35105/src/adapter/core_support/mod.rs (L105)

Expected behavior
Making these do the same would make the behavior be less surprising.

Specifications (please complete the following information):

  • Version 0.7
**Describe the bug** By default `Uuid`s gets serialized with lowercase but their `fmt::Display` writes the uuid in uppercase. https://github.com/uuid-rs/uuid/blob/10e1b423aec4d118a1b162448f6289631c661bdf/src/serde_support.rs#L23 https://github.com/uuid-rs/uuid/blob/f414b351055c8cdae966e8758f6bd6a92820cda4/src/adapter/core_support/mod.rs#L105 **Expected behavior** Making these do the same would make the behavior be less surprising. **Specifications (please complete the following information):** - Version 0.7
kinggoesgaming commented 2018-09-21 09:58:46 -05:00 (Migrated from github.com)

Thanks @Marwes for the report. That is indeed a bug. It should be lowercase by default

Thanks @Marwes for the report. That is indeed a bug. It should be lowercase by default
Dylan-DPC-zz commented 2018-09-21 10:05:02 -05:00 (Migrated from github.com)

Hi @Marwes you are free to submit a PR that fixes it. Else will get it done myself whenever possible.

Hi @Marwes you are free to submit a PR that fixes it. Else will get it done myself whenever possible.
Marwes commented 2018-09-21 14:05:26 -05:00 (Migrated from github.com)

Wait, no this is actually correct. Both implementations use lower case I just got things mixed up with a Uuid wrapper I have which defaults to uppercase :(

Wait, no this is actually correct. Both implementations use lower case I just got things mixed up with a Uuid wrapper I have which defaults to uppercase :(
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid#323
No description provided.