util/error: refactor error handling

This commit is contained in:
meh
2015-05-24 18:51:34 +02:00
parent 2716893612
commit 5b80b10949
13 changed files with 205 additions and 101 deletions

View File

@ -27,7 +27,7 @@ impl<'a> DeviceIter<'a> {
match avdevice_list_devices(ctx, &mut ptr) {
n if n < 0 =>
Err(Error::new(n)),
Err(Error::from(n)),
_ =>
Ok(DeviceIter { ptr: ptr, cur: 0, _marker: PhantomData })