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 upRemove some usage of unstable features #18839
Conversation
highfive
commented
Oct 11, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Oct 11, 2017
|
@bors-servo try |
Remove some usage of unstable features `Box::new(x)` seems to compile to exactly the same assembly as `box x` in release mode: https://play.rust-lang.org/?gist=55ec5dd02c22fa799375d6e2e1a6e970&version=nightly <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18839) <!-- Reviewable:end -->
|
|
|
IIRC removing |
|
3 remarks, but r=me if you don't want to make the suggested changes. |
| @@ -109,7 +109,8 @@ fn is_image_opaque(format: webrender_api::ImageFormat, bytes: &[u8]) -> bool { | |||
| fn premultiply(data: &mut [u8]) { | |||
| let length = data.len(); | |||
|
|
|||
| for i in Iterator::step_by(0..length, 4) { | |||
| let mut i = 0; | |||
| while i < length { | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
SimonSapin
Oct 12, 2017
Author
Member
The last item of chunks can be a smaller slice, whereas this loop will stop before.
| @@ -50,14 +50,17 @@ pub struct ImageMetadata { | |||
| fn byte_swap_and_premultiply(data: &mut [u8]) { | |||
| let length = data.len(); | |||
|
|
|||
| for i in Iterator::step_by(0..length, 4) { | |||
| let mut i = 0; | |||
| while i < length { | |||
This comment has been minimized.
This comment has been minimized.
|
|
||
| fn try_from(position: &'a str) -> Result<AdjacentPosition, Self::Error> { | ||
| impl AdjacentPosition { | ||
| fn try_from(position: &str) -> Result<AdjacentPosition, Error> { |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=nox |
|
|
Remove some usage of unstable features `Box::new(x)` seems to compile to exactly the same assembly as `box x` in release mode: https://play.rust-lang.org/?gist=55ec5dd02c22fa799375d6e2e1a6e970&version=nightly <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18839) <!-- Reviewable:end -->
|
|
SimonSapin commentedOct 11, 2017
•
edited
Box::new(x)seems to compile to exactly the same assembly asbox xin release mode:https://play.rust-lang.org/?gist=55ec5dd02c22fa799375d6e2e1a6e970&version=nightly
This change is