Skip to content

Use values for all Float methods#82

Merged
bors[bot] merged 2 commits intorust-num:masterfrom
cuviper:float-by-value
Jun 13, 2020
Merged

Use values for all Float methods#82
bors[bot] merged 2 commits intorust-num:masterfrom
cuviper:float-by-value

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.

cuviper added 2 commits June 13, 2020 11:54
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