Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Nov 22, 2021
1 parent a7ba4a0 commit c429ed9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,21 @@ pub struct TlFactory<'a> {

impl<'a> TlFactory<'a> {
pub fn instance(lib: &'a Pylon) -> Self {
Self {lib}
Self { lib }
}
pub fn create_first_device(&self) -> PylonResult<InstantCamera<'a>> {
let inner = ffi::tl_factory_create_first_device()?;
Ok(InstantCamera { lib: self.lib, inner })
Ok(InstantCamera {
lib: self.lib,
inner,
})
}
pub fn create_device(&self, device_info: &DeviceInfo) -> PylonResult<InstantCamera<'a>> {
let inner = ffi::tl_factory_create_device(&device_info.inner)?;
Ok(InstantCamera { lib: self.lib, inner })
Ok(InstantCamera {
lib: self.lib,
inner,
})
}
pub fn enumerate_devices(&self) -> PylonResult<Vec<DeviceInfo>> {
let devs: cxx::UniquePtr<cxx::CxxVector<ffi::CDeviceInfo>> =
Expand Down

0 comments on commit c429ed9

Please sign in to comment.