diff --git a/components/derive_common/cg.rs b/components/derive_common/cg.rs index 106cea95c9d..a2eed8daf6c 100644 --- a/components/derive_common/cg.rs +++ b/components/derive_common/cg.rs @@ -368,7 +368,7 @@ pub fn to_css_identifier(mut camel_case: &str) -> String { } } if !first { - result.push_str("-"); + result.push('-'); } first = false; result.push_str(&segment.to_lowercase()); diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 5169c3a1ade..505d7d51c89 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -770,7 +770,7 @@ impl Arc> { // We should have consumed the buffer exactly, maybe accounting // for some padding from the alignment. debug_assert!( - (buffer.offset(size as isize) as usize - current as *mut u8 as usize) < + (buffer.add(size) as usize - current as *mut u8 as usize) < inner_align ); } @@ -858,8 +858,8 @@ impl HeaderWithLength { /// Creates a new HeaderWithLength. pub fn new(header: H, length: usize) -> Self { HeaderWithLength { - header: header, - length: length, + header, + length, } } } diff --git a/components/to_shmem/lib.rs b/components/to_shmem/lib.rs index cab0fba3748..ebe18534306 100644 --- a/components/to_shmem/lib.rs +++ b/components/to_shmem/lib.rs @@ -170,7 +170,7 @@ impl SharedMemoryBuilder { assert!(end <= self.capacity); self.index = end; - unsafe { self.buffer.offset(start as isize) as *mut T } + unsafe { self.buffer.add(start) as *mut T } } }