Skip to content

Conversation

tarcieri
Copy link
Member

Moves them from being free functions to inherent methods on Array.

This avoids having to import them separately.

Moves them from being free functions to inherent methods on `Array`.

This avoids having to import them separately.
@tarcieri tarcieri requested a review from newpavlov January 28, 2024 00:27
@tarcieri
Copy link
Member Author

@newpavlov if you'd like to leave these as free functions I'm fine with that too. There's certainly precedent for that sort of thing in core::array.

Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

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

I am fine with both options, but the inherent methods look slightly more ergonomic. Not only you do not have to explicitly import them, but they also can simplify type hinting, i.e. we will be able to write Block::slice_as_chunks(buf).

@tarcieri
Copy link
Member Author

Yeah, that should be useful

@tarcieri tarcieri merged commit f68ed30 into master Jan 29, 2024
@tarcieri tarcieri deleted the make-slice-as-chunks-inherent-methods branch January 29, 2024 03:16
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.

2 participants