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

Make DrawBuilder non-consuming #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Make DrawBuilder non-consuming #1

wants to merge 1 commit into from

Conversation

alteous
Copy link

@alteous alteous commented May 13, 2017

By taking &mut self instead of mut self, the user will be able to chain calls
more ergonomically.

This pattern is recommended by the Rust API guidelines.

By taking `&mut self` instead of `mut self`, the user will be able to chain calls
[more ergonomically](https://github.com/brson/rust-api-guidelines#the-benefit).

This pattern is recommended by the [Rust API guidelines].
(https://github.com/brson/rust-api-guidelines#non-consuming-builders-preferred)
@gregtatum
Copy link
Owner

I think the reason why I didn't do this the first time was the impact to the user-facing API. It has a bit more overhead to consume the data, but that's initialization work not real-time work. Is there a way to do this without making the draw building API more verbose? I think I'd be OK with a small perf hit for some better developer ergonomics.

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