Explorar o código

Return tuntap err instead of unwrap

ngc0202 %!s(int64=3) %!d(string=hai) anos
pai
achega
7979b7ab1a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)
         }