Kaynağa Gözat

Return tuntap err instead of unwrap

ngc0202 2 yıl önce
ebeveyn
işleme
7979b7ab1a
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      src/phy/sys/tuntap_interface.rs

+ 1 - 1
src/phy/sys/tuntap_interface.rs

@@ -103,7 +103,7 @@ impl TunTapInterfaceDesc {
                 buffer.len(),
             );
             if len == -1 {
-                Err(io::Error::last_os_error()).unwrap()
+                return Err(io::Error::last_os_error());
             }
             Ok(len as usize)
         }