Skip to content

Commit

Permalink
Enforce some lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Sep 25, 2017
1 parent a983c62 commit cedf66a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ extern crate byteorder;
mod utils;

use std::str::{self, FromStr};
use std::cmp;
use std::time::Instant;
use std::os::unix::io::AsRawFd;
use smoltcp::phy::wait as phy_wait;
Expand Down
4 changes: 2 additions & 2 deletions src/iface/ethernet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
}

fn process_ipv4<'frame, T: AsRef<[u8]>>
(&mut self, sockets: &mut SocketSet, timestamp: u64,
(&mut self, sockets: &mut SocketSet, _timestamp: u64,
eth_frame: &EthernetFrame<&'frame T>) ->
Result<Packet<'frame>> {
let ipv4_packet = Ipv4Packet::new_checked(eth_frame.payload())?;
Expand Down Expand Up @@ -329,7 +329,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {

#[cfg(feature = "socket-tcp")]
IpProtocol::Tcp =>
Self::process_tcp(sockets, timestamp, ip_repr, ip_payload),
Self::process_tcp(sockets, _timestamp, ip_repr, ip_payload),

#[cfg(feature = "socket-raw")]
_ if handled_by_raw_socket =>
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg_attr(feature = "alloc", feature(alloc))]
#![no_std]
#![deny(unsafe_code, unused)]

//! The _smoltcp_ library is built in a layered structure, with the layers corresponding
//! to the levels of API abstraction. Only the highest layers would be used by a typical
Expand Down Expand Up @@ -67,6 +68,12 @@
//! feature ever defined, to ensure that, when the representation layer is unable to make sense
//! of a packet, it is still logged correctly and in full.
/* XXX compiler bug
#![cfg(not(any(feature = "socket-raw",
feature = "socket-udp",
feature = "socket-tcp")))]
compile_error!("at least one socket needs to be enabled"); */

extern crate byteorder;
extern crate managed;
#[cfg(any(test, feature = "std"))]
Expand Down
2 changes: 2 additions & 0 deletions src/phy/sys/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(unsafe_code)]

use libc;
use std::{mem, ptr, io};
use std::os::unix::io::RawFd;
Expand Down

0 comments on commit cedf66a

Please sign in to comment.