Bladeren bron

Fix warnings.

whitequark 7 jaren geleden
bovenliggende
commit
c5deacbcb8
2 gewijzigde bestanden met toevoegingen van 7 en 8 verwijderingen
  1. 3 4
      src/socket/tcp.rs
  2. 4 4
      src/storage/ring_buffer.rs

+ 3 - 4
src/socket/tcp.rs

@@ -2,7 +2,6 @@
 // the parts of RFC 1122 that discuss TCP.
 
 use core::{cmp, fmt};
-use managed::Managed;
 
 use {Error, Result};
 use phy::DeviceLimits;
@@ -1266,7 +1265,7 @@ mod test {
         window_len: 256, max_seg_size: None,
         payload: &[]
     };
-    const RECV_IP_TEMPL: IpRepr = IpRepr::Unspecified {
+    const _RECV_IP_TEMPL: IpRepr = IpRepr::Unspecified {
         src_addr: REMOTE_IP, dst_addr: LOCAL_IP,
         protocol: IpProtocol::Tcp, payload_len: 20
     };
@@ -1409,7 +1408,7 @@ mod test {
     // =========================================================================================//
     #[test]
     fn test_closed_reject() {
-        let mut s = socket();
+        let s = socket();
         assert_eq!(s.state, State::Closed);
 
         let tcp_repr = TcpRepr {
@@ -1483,7 +1482,7 @@ mod test {
 
     #[test]
     fn test_listen_syn_reject_ack() {
-        let mut s = socket_listen();
+        let s = socket_listen();
 
         let tcp_repr = TcpRepr {
             control: TcpControl::Syn,

+ 4 - 4
src/storage/ring_buffer.rs

@@ -1,5 +1,5 @@
 use core::cmp;
-use managed::{Managed, ManagedSlice};
+use managed::ManagedSlice;
 
 use {Error, Result};
 use super::Resettable;
@@ -380,7 +380,7 @@ mod test {
         assert_eq!(ring.len(), 8);
         assert_eq!(&ring.storage[..], b"abcdefgh....");
 
-        for i in 0..4 {
+        for _ in 0..4 {
             *ring.dequeue_one().unwrap() = b'.';
         }
         assert_eq!(ring.len(), 4);
@@ -402,7 +402,7 @@ mod test {
         assert_eq!(ring.len(), 12);
         assert_eq!(&ring.storage[..], b"abcdefghijkl");
 
-        for i in 0..4 {
+        for _ in 0..4 {
             *ring.dequeue_one().unwrap() = b'.';
         }
         assert_eq!(ring.len(), 8);
@@ -430,7 +430,7 @@ mod test {
         assert_eq!(ring.len(), 8);
         assert_eq!(&ring.storage[..], b"abcdefgh....");
 
-        for i in 0..4 {
+        for _ in 0..4 {
             *ring.dequeue_one().unwrap() = b'.';
         }
         assert_eq!(ring.len(), 4);