mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Minor alsa backend tweaks
Silence a clippy warning and we don't need `std::cmp::min` when `usize` already has `min`.
This commit is contained in:
parent
95dc9f8411
commit
5a10a963ff
1 changed files with 2 additions and 3 deletions
|
@ -6,7 +6,6 @@ use crate::{NUM_CHANNELS, SAMPLE_RATE};
|
||||||
use alsa::device_name::HintIter;
|
use alsa::device_name::HintIter;
|
||||||
use alsa::pcm::{Access, Format, Frames, HwParams, PCM};
|
use alsa::pcm::{Access, Format, Frames, HwParams, PCM};
|
||||||
use alsa::{Direction, ValueOr};
|
use alsa::{Direction, ValueOr};
|
||||||
use std::cmp::min;
|
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
@ -141,7 +140,7 @@ fn list_compatible_devices() -> SinkResult<()> {
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"\tDescription:\n\n\t\t{}\n",
|
"\tDescription:\n\n\t\t{}\n",
|
||||||
a.desc.unwrap_or_default().replace("\n", "\n\t\t")
|
a.desc.unwrap_or_default().replace('\n', "\n\t\t")
|
||||||
);
|
);
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
|
@ -467,7 +466,7 @@ impl SinkAsBytes for AlsaSink {
|
||||||
loop {
|
loop {
|
||||||
let data_left = data_len - start_index;
|
let data_left = data_len - start_index;
|
||||||
let space_left = capacity - self.period_buffer.len();
|
let space_left = capacity - self.period_buffer.len();
|
||||||
let data_to_buffer = min(data_left, space_left);
|
let data_to_buffer = data_left.min(space_left);
|
||||||
let end_index = start_index + data_to_buffer;
|
let end_index = start_index + data_to_buffer;
|
||||||
|
|
||||||
self.period_buffer
|
self.period_buffer
|
||||||
|
|
Loading…
Reference in a new issue