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

Callables to builtin methods; Array::bsearch_by, sort_unstable_by #1064

Merged
merged 4 commits into from
Mar 4, 2025

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Mar 2, 2025

Adds Callable::from_variant_method(), matching Godot's Callable.create(). This can be used to invoke non-static builtin methods (e.g. on GString).

Also adds two Array APIs which now can use type-safe Rust comparators instead of their _custom variants accepting Callables:

  • array.bsearch_by(|e| e.cmp(&value))
  • array.sort_unstable_by(|a, b| a.cmp(b))

@Bromeon Bromeon added feature Adds functionality to the library c: core Core components labels Mar 2, 2025
@Bromeon Bromeon force-pushed the feature/callable-convenience-apis branch from 939b200 to d9653de Compare March 2, 2025 22:45
@GodotRust
Copy link

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

@Bromeon Bromeon force-pushed the feature/callable-convenience-apis branch from d9653de to 4c48b40 Compare March 3, 2025 22:13
@Bromeon Bromeon force-pushed the feature/callable-convenience-apis branch from 4c48b40 to 8ad0ac7 Compare March 3, 2025 22:20
@Bromeon Bromeon force-pushed the feature/callable-convenience-apis branch from 8ad0ac7 to 44a479c Compare March 3, 2025 22:22
@Bromeon Bromeon added this pull request to the merge queue Mar 4, 2025
Merged via the queue into master with commit 17a4650 Mar 4, 2025
16 checks passed
@Bromeon Bromeon deleted the feature/callable-convenience-apis branch March 4, 2025 20:39
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.

2 participants