Skip to content

Commit 37f64b7

Browse files
committed
Appease clippy.
1 parent 76e5998 commit 37f64b7

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

bitcode_derive/src/encode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl crate::shared::Item for Item {
156156
})
157157
.collect();
158158
quote! {
159-
#[allow(unused_variables)]
159+
#[allow(unused_variables, unused_assignments)]
160160
self.variants.encode(&match v {
161161
#variants
162162
});
@@ -300,15 +300,15 @@ impl crate::shared::Derive<{ Item::COUNT }> for Encode {
300300

301301
// #[cfg_attr(not(debug_assertions), inline(always))]
302302
// #[inline(never)]
303-
fn encode_vectored<'__v>(&mut self, i: impl Iterator<Item = &'__v #input_ty> + Clone) where #input_ty: '__v {
303+
fn encode_vectored<'__v>(&mut self, #[allow(unused)] i: impl Iterator<Item = &'__v #input_ty> + Clone) where #input_ty: '__v {
304304
#[allow(unused_imports)]
305305
use #private::Buffer as _;
306306
#encode_vectored_body
307307
}
308308
}
309309

310310
impl #encoder_impl_generics #private::Buffer for #encoder_ty #encoder_where_clause {
311-
fn collect_into(&mut self, out: &mut #private::Vec<u8>) {
311+
fn collect_into(&mut self, #[allow(unused)] out: &mut #private::Vec<u8>) {
312312
#collect_into_body
313313
}
314314

src/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl<'a> View<'a> for BoolDecoder<'a> {
4242

4343
impl<'a> Decoder<'a, bool> for BoolDecoder<'a> {
4444
#[inline(always)]
45-
fn as_primitive(&mut self) -> Option<&mut SliceImpl<Unaligned<bool>>> {
45+
fn as_primitive(&mut self) -> Option<&mut SliceImpl<'_, Unaligned<bool>>> {
4646
// Safety: `Unaligned<bool>` is equivalent to bool since it's a `#[repr(C, packed)]` wrapper
4747
// around bool and both have size/align of 1.
4848
unsafe { Some(core::mem::transmute(self.0.mut_slice())) }

src/coder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub trait Decoder<'a, T>: View<'a> + Default + Send + Sync {
7171
/// Returns a `&mut SliceImpl<Unaligned<T>>` if `T` is a type that can be decoded by copying.
7272
/// Uses `Unaligned<T>` so `IntDecoder` can borrow from input `[u8]`.
7373
#[inline(always)]
74-
fn as_primitive(&mut self) -> Option<&mut SliceImpl<Unaligned<T>>> {
74+
fn as_primitive(&mut self) -> Option<&mut SliceImpl<'_, Unaligned<T>>> {
7575
None
7676
}
7777

src/derive/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'a, T: Decode<'a>, const N: usize> View<'a> for ArrayDecoder<'a, T, N> {
7676
}
7777

7878
impl<'a, T: Decode<'a>, const N: usize> Decoder<'a, [T; N]> for ArrayDecoder<'a, T, N> {
79-
fn as_primitive(&mut self) -> Option<&mut FastSlice<Unaligned<[T; N]>>> {
79+
fn as_primitive(&mut self) -> Option<&mut FastSlice<'_, Unaligned<[T; N]>>> {
8080
self.0.as_primitive().map(|s| {
8181
// Safety: FastSlice doesn't have a length unlike slice, so casting to FastSlice<[T; N]>
8282
// is safe. N == 0 case is also safe for the same reason.

src/derive/impls.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ macro_rules! impl_both {
2828
}
2929
};
3030
}
31-
pub(crate) use impl_both;
3231
impl_both!(bool, BoolEncoder, BoolDecoder);
3332
impl_both!(f32, F32Encoder, F32Decoder);
3433
impl_both!(String, StrEncoder, StrDecoder);

src/derive/vec.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ macro_rules! unsafe_wild_copy {
7777
}
7878
}
7979
}
80+
#[allow(unused_imports)]
8081
pub(crate) use unsafe_wild_copy;
8182

8283
impl<T: Encode> VecEncoder<T> {

src/int.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'a, T: Int> View<'a> for IntDecoder<'a, T> {
6161
// Makes IntDecoder<u32> able to decode i32/f32 (but not char since it can fail).
6262
impl<'a, T: Int, P: Pod> Decoder<'a, P> for IntDecoder<'a, T> {
6363
#[inline(always)]
64-
fn as_primitive(&mut self) -> Option<&mut SliceImpl<Unaligned<P>>> {
64+
fn as_primitive(&mut self) -> Option<&mut SliceImpl<'_, Unaligned<P>>> {
6565
Some(self.0.mut_slice().cast())
6666
}
6767

@@ -107,7 +107,7 @@ where
107107
<C as CheckedBitPattern>::Bits: Pod,
108108
{
109109
#[inline(always)]
110-
fn as_primitive(&mut self) -> Option<&mut SliceImpl<Unaligned<C>>> {
110+
fn as_primitive(&mut self) -> Option<&mut SliceImpl<'_, Unaligned<C>>> {
111111
self.0
112112
.as_primitive()
113113
.map(|p: &mut SliceImpl<'_, Unaligned<I>>| {

0 commit comments

Comments
 (0)