Skip to content

Commit

Permalink
device/queue: simplify unneeded match statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Sep 5, 2023
1 parent 0c7db64 commit 9fd5ae3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/src/device/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use super::{AllocatedQueue, Device, FreeBuffersResult, Stream, TryDequeue};
use crate::{bindings, memory::*};
use crate::{
ioctl::{
self, DqBufError, DqBufResult, GFmtError, QueryBuffer, ReqbufsError, SFmtError,
SelectionTarget, SelectionType, StreamOffError, StreamOnError, TryFmtError,
self, DqBufResult, GFmtError, QueryBuffer, ReqbufsError, SFmtError, SelectionTarget,
SelectionType, StreamOffError, StreamOnError, TryFmtError,
},
PlaneLayout, Rect,
};
Expand Down Expand Up @@ -485,12 +485,7 @@ impl<D: Direction, P: BufferHandles> TryDequeue for Queue<D, BuffersAllocated<P>
type Dequeued = DqBuffer<D, P>;

fn try_dequeue(&self) -> DqBufResult<Self::Dequeued> {
let dqbuf: ioctl::V4l2Buffer = match ioctl::dqbuf(&self.inner, self.inner.type_) {
Ok(dqbuf) => dqbuf,
Err(DqBufError::Eos) => return Err(DqBufError::Eos),
Err(DqBufError::NotReady) => return Err(DqBufError::NotReady),
Err(DqBufError::IoctlError(e)) => return Err(DqBufError::IoctlError(e)),
};
let dqbuf: ioctl::V4l2Buffer = ioctl::dqbuf(&self.inner, self.inner.type_)?;

let id = dqbuf.index() as usize;

Expand Down

0 comments on commit 9fd5ae3

Please sign in to comment.