summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
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())
}