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

Rust traits Display, Hash and Eq exposed to Kotlin and Swift. #1817

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

mhammond
Copy link
Member

This brings those language to parity with Python.

Note that Kotin is using Display for toString() and there's no obvious way to expose Debug, so it isn't. Swift does seem to have a sensible way of exposing both Debug and Display.

Neither language seems to need ne so that's unused.

This brings those language to parity with Python.
@mhammond mhammond requested a review from jhugman October 30, 2023 14:17
@mhammond mhammond requested a review from a team as a code owner October 30, 2023 14:17
@badboy
Copy link
Member

badboy commented Nov 2, 2023

Swift does seem to have a sensible way of exposing both Debug and Display.

What do you mean by this?
From the code you don't seem to special-case anything there and you use both CustomDebugStringConvertible and CustomStringConvertible, so I'm a bit confused by your description here.

@mhammond
Copy link
Member Author

mhammond commented Nov 2, 2023

Sorry for the confusion: I was trying to say that Kotlin is able to get Display output but unable to get Debug, whereas Swift, like Python (__str__ vs __repr__) is able to get both.

Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +133 to +135
{%- else %}
{%- endmatch %}
{%- endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mhammond mhammond merged commit b369e7c into mozilla:main Nov 6, 2023
5 checks passed
@mhammond mhammond deleted the utraits branch November 6, 2023 16:24
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.

None yet

3 participants