monoclient: fix clippy issues

Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
Ivan Bushchik 2024-07-13 22:20:57 +03:00
parent 7e8f797533
commit eaa7262d37
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C

View file

@ -5,7 +5,6 @@ use crossterm::style::Print;
use crossterm::terminal::{Clear, ClearType}; use crossterm::terminal::{Clear, ClearType};
use lonelyradio_types::{Encoder, Settings}; use lonelyradio_types::{Encoder, Settings};
use std::io::stdout; use std::io::stdout;
use std::path::PathBuf;
use std::sync::OnceLock; use std::sync::OnceLock;
use std::time::Instant; use std::time::Instant;
@ -16,9 +15,6 @@ struct Args {
/// Remote address /// Remote address
address: String, address: String,
#[arg(long)]
xor_key_file: Option<PathBuf>,
#[arg(short, long)] #[arg(short, long)]
verbose: bool, verbose: bool,
} }
@ -44,7 +40,6 @@ fn main() {
std::thread::spawn(move || { std::thread::spawn(move || {
monolib::run( monolib::run(
&args.address, &args.address,
args.xor_key_file.map(|key| std::fs::read(key).expect("Failed to read preshared key")),
Settings { Settings {
encoder: Encoder::PcmFloat, encoder: Encoder::PcmFloat,
cover: -1, cover: -1,
@ -68,7 +63,6 @@ fn main() {
)) ))
) )
.unwrap(); .unwrap();
let mut track_length = md.track_length_secs as f64 + md.track_length_frac as f64;
let mut next_md = md.clone(); let mut next_md = md.clone();
crossterm::terminal::enable_raw_mode().unwrap(); crossterm::terminal::enable_raw_mode().unwrap();
loop { loop {
@ -138,7 +132,6 @@ fn main() {
); );
track_start = Instant::now(); track_start = Instant::now();
seconds_past = 0; seconds_past = 0;
track_length = md.track_length_secs as f64 + md.track_length_frac as f64
} else if next_md == md { } else if next_md == md {
next_md = monolib::get_metadata().unwrap(); next_md = monolib::get_metadata().unwrap();
} }