From da684ab0f7f49b2d901de07852fd260437d55323 Mon Sep 17 00:00:00 2001 From: Zach Dziura Date: Tue, 28 Apr 2015 18:40:22 +0000 Subject: [PATCH] Updated main lib file to use new Error struct --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index eb13070..4c1a5c6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,11 +21,11 @@ mod opts; use std::env::Args; -pub use errors::ErrorKind; +pub use errors::{Error, ErrorKind}; pub use matches::Matches; use opts::Opts; -pub fn parse(mut args: Args, options: &[&'static str]) -> Result { +pub fn parse(mut args: Args, options: &[&'static str]) -> Result { let mut matches: Matches = Matches::new(); let mut opts: Opts = opts(options); // Jesus, this is redundant... @@ -52,7 +52,7 @@ pub fn parse(mut args: Args, options: &[&'static str]) -> Result { - return Err(ErrorKind::MissingArgument); + return Err(Error::new(ErrorKind::MissingArgument, arg)); }, Some(a) => a }; @@ -62,7 +62,7 @@ pub fn parse(mut args: Args, options: &[&'static str]) -> Result