Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSome refactoring and documentation for scale.rs #410
Merged
+184
−125
Conversation
This was referenced Mar 15, 2020
Merged
src/scale.rs
Outdated
| @@ -65,7 +65,7 @@ impl<T: Clone + One + Div<T, Output = T>, Src, Dst> Scale<T, Src, Dst> { | |||
| /// The inverse Scale (1.0 / self). | |||
| pub fn inv(&self) -> Scale<T, Dst, Src> { | |||
| let one: T = One::one(); | |||
| Scale::new(one / self.get()) | |||
| Scale::new(one / self.0.clone()) | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Mingun
Mar 20, 2020
Author
Contributor
This is just preparation to change &self to self. get still require Clone bound (although at my sight, I would completely delete that method)
|
|
bors-servo
added a commit
that referenced
this pull request
Mar 30, 2020
|
@bors-servo r+ |
|
|
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Mingun commentedMar 14, 2020
•
edited
Actually, this is part of a changes whose ultimate goal is to improve the ergonomics of the library. There are too many of them, so some of them I decided to provide in separate PRs. That is first.
Commit 19ddcfe introduce soft breaking change. I call it soft because very unlikely, that users faced with them, because that only replaces borrow with move for
selfparameter -- but if you don't use UFCS, you even will not notice that. And because before that changeCopytype was required, after that change that method always called withCopytypes, so no errors, related to borrow checker, can occur if you simply upgraded to new version of the library. Benefit in that after this change you can control if you wish to make a copy, and that methods can now work with non-Copy types.