diff options
author | Carl Lerche <me@carllerche.com> | 2015-04-07 13:26:18 -0700 |
---|---|---|
committer | Carl Lerche <me@carllerche.com> | 2015-04-07 13:26:18 -0700 |
commit | 7fb87b5dce4271f29a3cdaed63b28bef9a1abf31 (patch) | |
tree | d643226a6b834846d861fe62566fa9e1b108cc12 | |
parent | f43ecde470b1c4a71e452f9c5bcf7b76e92c5a06 (diff) | |
download | nix-7fb87b5dce4271f29a3cdaed63b28bef9a1abf31.zip |
Add Error::from_errno
-rw-r--r-- | src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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()) } |