Skip to content

Commit 172265e

Browse files
authored
Merge pull request #66 from vitiral/into_error
add GlobError::into_error so that errors can be easily converted
2 parents fc308b1 + 99d5f12 commit 172265e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#![deny(missing_docs)]
6262
#![cfg_attr(all(test, windows), feature(std_misc))]
6363

64+
#[allow(unused_imports)]
6465
use std::ascii::AsciiExt;
6566
use std::cmp;
6667
use std::fmt;
@@ -279,12 +280,18 @@ impl GlobError {
279280
pub fn error(&self) -> &io::Error {
280281
&self.error
281282
}
283+
284+
/// Consumes self, returning the _raw_ underlying `io::Error`
285+
pub fn into_error(self) -> io::Error {
286+
self.error
287+
}
282288
}
283289

284290
impl Error for GlobError {
285291
fn description(&self) -> &str {
286292
self.error.description()
287293
}
294+
288295
fn cause(&self) -> Option<&Error> {
289296
Some(&self.error)
290297
}

0 commit comments

Comments
 (0)