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

Add PoolArray::to_vec(), improve doc around read()/write() #843

Merged
merged 1 commit into from Jan 8, 2022

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Jan 4, 2022

Closes #806.

I noticed that the documentation around the read() and write() methods was a bit lacking, and tried to make it a bit easier to understand. Also moved trait impls after the inherent impl.

I'm not 100% sure that we really need to_vec(). It's nice as a convenience, but it may cause people to do things like

pool_array.to_vec().map(...).collect()
// or
for elem in pool_array.to_vec()

instead of going via read(). After all, read().to_vec() is not much longer.
On the other hand, we already have PoolArray::from_vec(), so it's somewhat symmetric.

I'd be happy for some input on that.

@Bromeon Bromeon added c: core Component: core (mod core_types, object, log, init, ...) quality-of-life No new functionality, but improves ergonomics/internals labels Jan 4, 2022
@Bromeon Bromeon added this to the v0.10.0 milestone Jan 4, 2022
@Bromeon
Copy link
Member Author

Bromeon commented Jan 8, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 8, 2022

Build succeeded:

@bors bors bot merged commit cf2e124 into godot-rust:master Jan 8, 2022
@Bromeon Bromeon deleted the feature/pool-array-tovec branch January 8, 2022 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: core Component: core (mod core_types, object, log, init, ...) quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Converting TypedArray to Vec fails unexpectedly
1 participant