Skip to content

Commit c96bbd7

Browse files
committed
clippy
1 parent c01083b commit c96bbd7

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/readable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'ctx, 'r, 'a, C: Context> Reader<'r, C> for CopyingBufferReader<'ctx, 'a, C
184184

185185
#[inline(always)]
186186
fn context(&self) -> &C {
187-
&self.context
187+
self.context
188188
}
189189

190190
#[inline(always)]

src/reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub trait Reader<'a, C: Context>: Sized {
332332
let length = vec.len();
333333
unsafe {
334334
vec.set_len(length + 1);
335-
std::ptr::write(vec.as_mut_ptr().offset(length as isize), value);
335+
std::ptr::write(vec.as_mut_ptr().add(length), value);
336336
}
337337
}
338338

src/writable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'a, C: Context> Writer<C> for BufferCollector<'a, C> {
3030

3131
#[inline]
3232
fn context(&self) -> &C {
33-
&self.context
33+
self.context
3434
}
3535

3636
#[inline]

src/writer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ pub trait Writer<C: Context> {
7777

7878
#[inline(always)]
7979
fn write_f32(&mut self, value: f32) -> Result<(), C::Error> {
80-
let value: u32 = unsafe { mem::transmute(value) };
80+
let value: u32 = value.to_bits();
8181
self.write_u32(value)
8282
}
8383

8484
#[inline(always)]
8585
fn write_f64(&mut self, value: f64) -> Result<(), C::Error> {
86-
let value: u64 = unsafe { mem::transmute(value) };
86+
let value: u64 = value.to_bits();
8787
self.write_u64(value)
8888
}
8989

0 commit comments

Comments
 (0)