Skip to content

Commit 2b7dc14

Browse files
authored
refactor: add shared type for filtered devices (#819)
1 parent 6d4ce77 commit 2b7dc14

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,14 @@ pub mod platform;
182182
mod samples_formats;
183183
pub mod traits;
184184

185+
/// Iterator of devices wrapped in a filter to only include certain device types
186+
pub type DevicesFiltered<I> = std::iter::Filter<I, fn(&<I as Iterator>::Item) -> bool>;
187+
185188
/// A host's device iterator yielding only *input* devices.
186-
pub type InputDevices<I> = std::iter::Filter<I, fn(&<I as Iterator>::Item) -> bool>;
189+
pub type InputDevices<I> = DevicesFiltered<I>;
187190

188191
/// A host's device iterator yielding only *output* devices.
189-
pub type OutputDevices<I> = std::iter::Filter<I, fn(&<I as Iterator>::Item) -> bool>;
192+
pub type OutputDevices<I> = DevicesFiltered<I>;
190193

191194
/// Number of channels.
192195
pub type ChannelCount = u16;

0 commit comments

Comments
 (0)