Skip to content

impl Hash for Gd<T> per instance ID #504

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

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

jrockett6
Copy link
Contributor

I try to Hash Gd's a ton in my development, but end up working around not having this by hashing GString and calling get_node(), so this would be a nice convenience to have. Also others have inquired

If this isn't desired though feel to ignore.

Minor progress on #297

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-504

Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

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

Thanks!

Incidentally, we probably need to clean up some Godot hash functions in the API, created an issue #505.

@@ -654,6 +654,16 @@ impl<T: GodotClass> Debug for Gd<T> {
}
}

impl<T: GodotClass> std::hash::Hash for Gd<T> {
/// ⚠️ Hashes this object based on it's instance ID.
Copy link
Member

Choose a reason for hiding this comment

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

Small typo: its 🙂

@Bromeon Bromeon added this pull request to the merge queue Nov 27, 2023
@Bromeon Bromeon added feature Adds functionality to the library c: core Core components labels Nov 27, 2023
Merged via the queue into godot-rust:master with commit cf16a91 Nov 27, 2023
@jrockett6 jrockett6 deleted the hash_for_gd branch November 27, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Core components feature Adds functionality to the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants