From 7fb87b5dce4271f29a3cdaed63b28bef9a1abf31 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 7 Apr 2015 13:26:18 -0700 Subject: Add Error::from_errno --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index e9d26be6..69e3641e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,6 +55,10 @@ pub enum Error { } impl Error { + pub fn from_errno(errno: errno::Errno) -> Error { + Error::Sys(errno) + } + pub fn last() -> Error { Error::Sys(errno::Errno::last()) } -- cgit v1.2.3