Skip to content

Commit cedf66a

Browse files
committed
Enforce some lints.
1 parent a983c62 commit cedf66a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

examples/ping.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ extern crate byteorder;
88
mod utils;
99

1010
use std::str::{self, FromStr};
11-
use std::cmp;
1211
use std::time::Instant;
1312
use std::os::unix::io::AsRawFd;
1413
use smoltcp::phy::wait as phy_wait;

src/iface/ethernet.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl<'a, 'b, 'c, DeviceT: Device + 'a> Interface<'a, 'b, 'c, DeviceT> {
274274
}
275275

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

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

334334
#[cfg(feature = "socket-raw")]
335335
_ if handled_by_raw_socket =>

src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![cfg_attr(feature = "alloc", feature(alloc))]
22
#![no_std]
3+
#![deny(unsafe_code, unused)]
34

45
//! The _smoltcp_ library is built in a layered structure, with the layers corresponding
56
//! to the levels of API abstraction. Only the highest layers would be used by a typical
@@ -67,6 +68,12 @@
6768
//! feature ever defined, to ensure that, when the representation layer is unable to make sense
6869
//! of a packet, it is still logged correctly and in full.
6970
71+
/* XXX compiler bug
72+
#![cfg(not(any(feature = "socket-raw",
73+
feature = "socket-udp",
74+
feature = "socket-tcp")))]
75+
compile_error!("at least one socket needs to be enabled"); */
76+
7077
extern crate byteorder;
7178
extern crate managed;
7279
#[cfg(any(test, feature = "std"))]

src/phy/sys/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unsafe_code)]
2+
13
use libc;
24
use std::{mem, ptr, io};
35
use std::os::unix::io::RawFd;

0 commit comments

Comments
 (0)