Skip to content

Commit 7eb9753

Browse files
committed
virtio/snd: apply clippy suggestions
Signed-off-by: Sergio Lopez <[email protected]>
1 parent cfa5b5f commit 7eb9753

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/devices/src/virtio/snd/audio_backends/pipewire.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl AudioBackend for PwBackend {
194194
.write()
195195
.unwrap()
196196
.get_mut(stream_id as usize)
197-
.ok_or_else(|| Error::StreamWithIdNotFound(stream_id))?
197+
.ok_or(Error::StreamWithIdNotFound(stream_id))?
198198
.state
199199
.prepare();
200200
if let Err(err) = prepare_result {
@@ -501,7 +501,7 @@ impl AudioBackend for PwBackend {
501501
.write()
502502
.unwrap()
503503
.get_mut(stream_id as usize)
504-
.ok_or_else(|| Error::StreamWithIdNotFound(stream_id))?
504+
.ok_or(Error::StreamWithIdNotFound(stream_id))?
505505
.state
506506
.release();
507507
if let Err(err) = release_result {
@@ -530,7 +530,7 @@ impl AudioBackend for PwBackend {
530530
.write()
531531
.unwrap()
532532
.get_mut(stream_id as usize)
533-
.ok_or_else(|| Error::StreamWithIdNotFound(stream_id))?
533+
.ok_or(Error::StreamWithIdNotFound(stream_id))?
534534
.state
535535
.start();
536536
if let Err(err) = start_result {
@@ -555,7 +555,7 @@ impl AudioBackend for PwBackend {
555555
.write()
556556
.unwrap()
557557
.get_mut(stream_id as usize)
558-
.ok_or_else(|| Error::StreamWithIdNotFound(stream_id))?
558+
.ok_or(Error::StreamWithIdNotFound(stream_id))?
559559
.state
560560
.stop();
561561
if let Err(err) = stop_result {

src/devices/src/virtio/snd/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type Result<T> = std::result::Result<T, Error>;
3838
/// - `SET PARAMETERS`
3939
///
4040
/// The driver negotiates the stream parameters (format, transport, etc) with
41-
/// the device.
41+
/// the device.
4242
///
4343
/// Possible valid transitions: `SET PARAMETERS`, `PREPARE`.
4444
///
@@ -47,7 +47,7 @@ type Result<T> = std::result::Result<T, Error>;
4747
/// The device prepares the stream (allocates resources, etc).
4848
///
4949
/// Possible valid transitions: `SET PARAMETERS`, `PREPARE`, `START`,
50-
/// `RELEASE`. Output only: the driver transfers data for pre-buffing.
50+
/// `RELEASE`. Output only: the driver transfers data for pre-buffing.
5151
///
5252
/// - `START`
5353
///

src/devices/src/virtio/snd/worker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ impl SndWorker {
661661
}
662662

663663
if !stream_ids.is_empty() {
664-
let b = self.audio_backend.write().unwrap();
664+
let b = self.audio_backend.read().unwrap();
665665
for id in stream_ids {
666666
b.write(id).unwrap();
667667
}

0 commit comments

Comments
 (0)