Remove unnecessary num crate from asio-sys

This commit is contained in:
mitchmindtree 2019-06-29 06:46:07 +10:00
parent c2b7c7f648
commit 86e3366063
3 changed files with 6 additions and 5 deletions

View File

@ -11,6 +11,5 @@ cc = "1.0.25"
[dependencies] [dependencies]
lazy_static = "1.0.0" lazy_static = "1.0.0"
num = "0.1.42" num-derive = "0.2"
num-traits = "0.2.2" num-traits = "0.2"
num-derive = "0.2.0"

View File

@ -2,6 +2,7 @@ mod asio_import;
#[macro_use] #[macro_use]
pub mod errors; pub mod errors;
use num_traits::FromPrimitive;
use self::errors::{AsioError, AsioErrorWrapper, LoadDriverError}; use self::errors::{AsioError, AsioErrorWrapper, LoadDriverError};
use std::ffi::CStr; use std::ffi::CStr;
use std::ffi::CString; use std::ffi::CString;
@ -320,7 +321,7 @@ impl Driver {
}; };
unsafe { unsafe {
asio_result!(ai::ASIOGetChannelInfo(&mut channel_info))?; asio_result!(ai::ASIOGetChannelInfo(&mut channel_info))?;
Ok(num::FromPrimitive::from_i32(channel_info.type_).expect("failed to cast sample type")) Ok(FromPrimitive::from_i32(channel_info.type_).expect("failed to cast sample type"))
} }
} }

View File

@ -4,10 +4,11 @@
#[macro_use] #[macro_use]
extern crate lazy_static; extern crate lazy_static;
extern crate num;
#[allow(unused_imports)] #[allow(unused_imports)]
#[macro_use] #[macro_use]
extern crate num_derive; extern crate num_derive;
#[allow(unused_imports)]
extern crate num_traits;
#[cfg(asio)] #[cfg(asio)]
pub mod bindings; pub mod bindings;