Skip to content

Make Packed*Array API more consistent with Array #725

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 5 commits into from
May 25, 2024

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented May 25, 2024

Somewhat follow-up to #720.

Adds Index/IndexMut for all packed arrays, allowing mutable/shared direct element access via p[index] operator.

Other changes (several breaking):

  • get() now returns Option<T> instead of T
  • deprecate set()
  • rename binary_search() -> bsearch()
  • optimize index access, since Godot already checks bounds and propagates that information
  • methods that don't insert the element now take &T instead of T, consistent with Array
  • changed method order, consistent with Array
  • documentation

@Bromeon Bromeon added feature Adds functionality to the library quality-of-life No new functionality, but improves ergonomics/internals c: core Core components labels May 25, 2024
@GodotRust
Copy link

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

@Bromeon Bromeon added this pull request to the merge queue May 25, 2024
Merged via the queue into master with commit 50ce26b May 25, 2024
15 checks passed
@Bromeon Bromeon deleted the qol/packed-array-cleanup branch May 25, 2024 12:18
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 quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants