瀏覽代碼

Return tuntap err instead of unwrap

ngc0202 2 年之前
父節點
當前提交
7979b7ab1a
共有 1 個文件被更改,包括 1 次插入1 次删除
  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)
         }