mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Make it possible to build the style_traits crate with a stable compiler.
Testing this on CI to make sure we don’t regress it is blocked on #11806
This commit is contained in:
parent
b9b289c4be
commit
ea73c8efac
20 changed files with 145 additions and 89 deletions
|
@ -9,10 +9,13 @@ use super::smallvec::VecLike;
|
|||
// TODO(pcwalton): Speed up with SIMD, or better yet, find some way to not do this.
|
||||
pub fn byte_swap(data: &mut [u8]) {
|
||||
let length = data.len();
|
||||
for i in (0..length).step_by(4) {
|
||||
// FIXME(rust #27741): Range::step_by is not stable yet as of this writing.
|
||||
let mut i = 0;
|
||||
while i < length {
|
||||
let r = data[i + 2];
|
||||
data[i + 2] = data[i + 0];
|
||||
data[i + 0] = r;
|
||||
i += 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue