diff --git a/nokhwa-core/src/buffer.rs b/nokhwa-core/src/buffer.rs index 689d696..9632fce 100644 --- a/nokhwa-core/src/buffer.rs +++ b/nokhwa-core/src/buffer.rs @@ -14,11 +14,7 @@ * limitations under the License. */ -use crate::{ - error::NokhwaError, - frame_format::FrameFormat, - types::{FrameFormat, Resolution}, -}; +use crate::{error::NokhwaError, frame_format::FrameFormat, types::Resolution}; use bytes::Bytes; use image::ImageBuffer; diff --git a/nokhwa-core/src/error.rs b/nokhwa-core/src/error.rs index e1523a5..da8d226 100644 --- a/nokhwa-core/src/error.rs +++ b/nokhwa-core/src/error.rs @@ -14,7 +14,8 @@ * limitations under the License. */ -use crate::types::{ApiBackend, FrameFormat}; +use crate::frame_format::FrameFormat; +use crate::types::ApiBackend; use thiserror::Error; /// All errors in `nokhwa`. diff --git a/nokhwa-core/src/types.rs b/nokhwa-core/src/types.rs index f8a804d..5037b38 100644 --- a/nokhwa-core/src/types.rs +++ b/nokhwa-core/src/types.rs @@ -1,5 +1,5 @@ use crate::frame_format::FrameFormat; -use crate::{error::NokhwaError, pixel_format::FormatDecoder}; +use crate::{error::NokhwaError, pixel_format::FormatDecoders}; #[cfg(feature = "serialize")] use serde::{Deserialize, Serialize}; use std::{ @@ -32,7 +32,9 @@ impl RequestedFormat<'_> { /// Creates a new [`RequestedFormat`] by using the [`RequestedFormatType`] and getting the [`FrameFormat`] /// constraints from a generic type. #[must_use] - pub fn new(requested: RequestedFormatType) -> RequestedFormat<'static> { + pub fn new( + requested: RequestedFormatType, + ) -> RequestedFormat<'static> { RequestedFormat { requested_format: requested, wanted_decoder: Decoder::FORMATS, diff --git a/src/camera.rs b/src/camera.rs index 92e91cf..5f35492 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -168,7 +168,7 @@ impl Camera { /// This will return the new [`CameraFormat`] /// # Errors /// If nothing fits the requested criteria, this will return an error. - pub fn set_camera_requset( + pub fn set_camera_request( &mut self, request: RequestedFormat, ) -> Result { @@ -182,7 +182,7 @@ impl Camera { Ok(new_format) } - #[deprecated(since = "0.10.0", note = "please use `set_camera_requset` instead.")] + #[deprecated(since = "0.10.0", note = "please use `set_camera_request` instead.")] /// Will set the current [`CameraFormat`] /// This will reset the current stream if used while stream is opened. /// diff --git a/src/threaded.rs b/src/threaded.rs index b295892..70fde8d 100644 --- a/src/threaded.rs +++ b/src/threaded.rs @@ -177,7 +177,7 @@ impl CallbackCamera { /// This will reset the current stream if used while stream is opened. /// # Errors /// If you started the stream and the camera rejects the new camera format, this will return an error. - #[deprecated(since = "0.10.0", note = "please use `set_camera_requset` instead.")] + #[deprecated(since = "0.10.0", note = "please use `set_camera_request` instead.")] pub fn set_camera_format(&mut self, new_fmt: CameraFormat) -> Result<(), NokhwaError> { *self .last_frame_captured @@ -193,7 +193,7 @@ impl CallbackCamera { .camera .lock() .map_err(|why| NokhwaError::GeneralError(why.to_string()))? - .set_camera_requset(request)?; + .set_camera_request(request)?; if new_fmt != set_fmt { return Err(NokhwaError::SetPropertyError { property: "CameraFormat".to_string(), @@ -212,14 +212,14 @@ impl CallbackCamera { /// This will return the new [`CameraFormat`] /// # Errors /// If nothing fits the requested criteria, this will return an error. - pub fn set_camera_requset( + pub fn set_camera_request( &mut self, request: RequestedFormat, ) -> Result { self.camera .lock() .map_err(|why| NokhwaError::GeneralError(why.to_string()))? - .set_camera_requset(request) + .set_camera_request(request) } /// A hashmap of [`Resolution`]s mapped to framerates /// # Errors