diff --git a/Cargo.toml b/Cargo.toml index c8b4ba9..30c868c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ license = "Apache-2.0" keywords = ["audio", "sound"] [dependencies] -libc = "0.2" lazy_static = "0.2" [target.'cfg(target_os = "windows")'.dependencies] @@ -19,6 +18,7 @@ kernel32-sys = "0.2" [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd"))'.dependencies] alsa-sys = { version = "0.1", path = "alsa-sys" } +libc = "0.2" [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies] coreaudio-rs = "0.7.0" diff --git a/examples/beep.rs b/examples/beep.rs index 44e6f0e..e611cfe 100644 --- a/examples/beep.rs +++ b/examples/beep.rs @@ -1,9 +1,5 @@ extern crate cpal; -use std::sync::Arc; -use std::thread; -use std::time::Duration; - fn main() { let endpoint = cpal::default_endpoint().expect("Failed to get default endpoint"); let format = endpoint diff --git a/src/alsa/enumerate.rs b/src/alsa/enumerate.rs index b6da734..e3e683e 100644 --- a/src/alsa/enumerate.rs +++ b/src/alsa/enumerate.rs @@ -1,14 +1,12 @@ - use super::Endpoint; use super::alsa; +use super::libc; use super::check_errors; use std::ffi::CStr; use std::ffi::CString; use std::mem; -use libc; - /// ALSA implementation for `EndpointsIterator`. pub struct EndpointsIterator { // we keep the original list so that we can pass it to the free function diff --git a/src/coreaudio/mod.rs b/src/coreaudio/mod.rs index 22fa76e..e816f06 100644 --- a/src/coreaudio/mod.rs +++ b/src/coreaudio/mod.rs @@ -1,5 +1,4 @@ extern crate coreaudio; -extern crate libc; use ChannelPosition; use CreationError; diff --git a/src/lib.rs b/src/lib.rs index 09af62f..d92a378 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,6 @@ from time to time. #[macro_use] extern crate lazy_static; -extern crate libc; pub use samples_formats::{Sample, SampleFormat}; diff --git a/src/wasapi/voice.rs b/src/wasapi/voice.rs index e972e0f..8ebd772 100644 --- a/src/wasapi/voice.rs +++ b/src/wasapi/voice.rs @@ -6,14 +6,12 @@ use super::kernel32; use super::ole32; use super::winapi; -use std::iter; use std::marker::PhantomData; use std::mem; use std::ptr; use std::slice; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::sync::Mutex; use ChannelPosition;