Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 27/configuring lint levels #53

Merged
merged 9 commits into from
Jun 1, 2021
12 changes: 7 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#![allow(incomplete_features)]
#![deny(noop_method_call, single_use_lifetimes, unreachable_pub, unsafe_code, unsafe_op_in_unsafe_fn, unused_import_braces, unused_lifetimes, warnings)]

#![no_std]
#![feature(cfg_eval)]

Expand Down Expand Up @@ -38,7 +41,7 @@ mod tests {
use std::format;

#[derive(Debug)]
pub struct ClassicFrame {
pub(super) struct ClassicFrame {
data: [u8; 8],
id: u32,
len: usize,
Expand All @@ -60,23 +63,22 @@ mod tests {
}
}

pub struct TxRxGlue<
pub(super) struct TxRxGlue<
'a,
Frame: CanFrame<MTU>,
Capacity: ArrayLength<Transfer<TransferCapacity>>,
TransferCapacity: ArrayLength<u8>,
const MTU: usize,
> {
pub rx_producer: RxProducer<'a, Frame, Capacity, TransferCapacity, MTU>,
pub(super) rx_producer: RxProducer<'a, Frame, Capacity, TransferCapacity, MTU>,
}

impl<
'a,
Frame: CanFrame<MTU>,
Capacity: ArrayLength<Transfer<TransferCapacity>>,
TransferCapacity: ArrayLength<u8>,
const MTU: usize,
> CanWriter<Frame, MTU> for TxRxGlue<'a, Frame, Capacity, TransferCapacity, MTU>
> CanWriter<Frame, MTU> for TxRxGlue<'_, Frame, Capacity, TransferCapacity, MTU>
{
type Error = RxError<Frame, MTU>;

Expand Down
6 changes: 2 additions & 4 deletions src/rx/rx_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ impl<
}

impl<
'a,
Frame: CanFrame<MTU>,
Capacity: ArrayLength<Transfer<TransferCapacity>>,
TransferCapacity: ArrayLength<u8>,
const MTU: usize,
> Iterator for RxConsumer<'a, Frame, Capacity, TransferCapacity, MTU>
> Iterator for RxConsumer<'_, Frame, Capacity, TransferCapacity, MTU>
{
type Item = Transfer<TransferCapacity>;

Expand All @@ -97,12 +96,11 @@ impl<
}

impl<
'a,
Frame: CanFrame<MTU>,
Capacity: ArrayLength<Transfer<TransferCapacity>>,
TransferCapacity: ArrayLength<u8>,
const MTU: usize,
> RxProducer<'a, Frame, Capacity, TransferCapacity, MTU>
> RxProducer<'_, Frame, Capacity, TransferCapacity, MTU>
{
pub fn receive(&mut self, frame: Frame) -> Result<(), RxError<Frame, MTU>> {
// println!("Received frame {:?}", frame);
Expand Down
2 changes: 1 addition & 1 deletion src/tx/breakdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl<'a, Frame: CanFrame<MTU>, const MTU: usize> Breakdown<'a, Frame, MTU> {
}
}

impl<'a, Frame: CanFrame<MTU>, const MTU: usize> Iterator for Breakdown<'a, Frame, MTU> {
impl<Frame: CanFrame<MTU>, const MTU: usize> Iterator for Breakdown<'_, Frame, MTU> {
type Item = Frame;

fn next(&mut self) -> Option<Self::Item> {
Expand Down