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

Use values for all Float methods #82

Merged
merged 2 commits into from
Jun 13, 2020
Merged

Conversation

cuviper
Copy link
Member

@cuviper cuviper commented Jun 13, 2020

Since T: Float also implies T: Copy, we don't need the indirection
of a reference for self or other parameters. Most of these are marked
#[inline] anyway, so in the end the change won't make much difference
to optimization, but it's semantically cleaner.

Users probably won't notice the change in method calls from &self to
self, but construction from_polar will need adjustment.

Fixes #80.

Since `T: Float` also implies `T: Copy`, we don't need the indirection
of a reference for `self` or other parameters. Most of these are marked
`#[inline]` anyway, so in the end the change won't make much difference
to optimization, but it's semantically cleaner.

Users probably won't notice the change in method calls from `&self` to
`self`, but construction `from_polar` will need adjustment.
@cuviper
Copy link
Member Author

cuviper commented Jun 13, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 13, 2020

@bors bors bot merged commit 160227d into rust-num:master Jun 13, 2020
cuviper added a commit to cuviper/num-complex that referenced this pull request Jun 13, 2020
@cuviper cuviper deleted the float-by-value branch February 6, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Complex::from_polar takes reference arguments
1 participant