Skip to content

Commit

Permalink
Fix doc tests
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher N. Hesse <raymanfx@gmail.com>
  • Loading branch information
raymanfx committed Oct 28, 2023
1 parent c11737e commit 52959d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eye-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
//!
//! // First, we need a capture device to read images from. For this example, let's just choose
//! // whatever device is first in the list.
//! let dev = ctx.open_device(&devices[0]).expect("Failed to open video device");
//! let dev = ctx.open_device(&devices[0].uri).expect("Failed to open video device");
//!
//! // Query for available streams and just choose the first one.
//! let streams = dev.streams().expect("Failed to query streams");
Expand Down
8 changes: 8 additions & 0 deletions eye-hal/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ impl<'a> Context<'a> {
}
}

impl<'a> Default for Context<'a> {
fn default() -> Self {
Self::all()
.next()
.expect("no contexts available for this platform")
}
}

impl<'a> ContextTrait<'a> for Context<'a> {
type Device = Device<'a>;

Expand Down

0 comments on commit 52959d6

Please sign in to comment.