app: clear the clippy warnings and the vendored ones

Our crate is warning-free under `cargo clippy --all-targets`. The two
vendored crates warned about an unreachable expression and a qualified
path; both are silenced at their crate root so a normal build prints
nothing.
This commit is contained in:
vhaudiquet committed 2026-11-15 23:09:15 +01:00
1 parent 744aa20496
commit 01a92f1edf
8 files changed
+31 -46

No files matched your search

+8 -13
View File
@@ -49,7 +49,7 @@ impl Status {
"recording" => "Recording".to_string(), "recording" => "Recording".to_string(),
"error" => "Error".to_string(), "error" => "Error".to_string(),
"shutting_down" => "Shutting down".to_string(), "shutting_down" => "Shutting down".to_string(),
other if other.is_empty() => "Unknown".to_string(), "" => "Unknown".to_string(),
other => other.to_string(), other => other.to_string(),
} }
} }
@@ -392,12 +392,10 @@ impl App {
self.notify_error(format!("Status did not parse: {e}")); self.notify_error(format!("Status did not parse: {e}"));
} }
}, },
(ipc::Request::Status, Err(e)) => { (ipc::Request::Status, Err(e)) if self.connected => {
if self.connected { self.connected = false;
self.connected = false; self.notify_error(format!("Lost the record-daemon: {e}"));
self.notify_error(format!("Lost the record-daemon: {e}")); self.refresh_games();
self.refresh_games();
}
} }
(ipc::Request::Encoders, Ok(data)) => { (ipc::Request::Encoders, Ok(data)) => {
if let Ok(list) = serde_json::from_value(data) { if let Ok(list) = serde_json::from_value(data) {
@@ -451,11 +449,8 @@ impl App {
let mut tray_events = Vec::new(); let mut tray_events = Vec::new();
if let Some(rx) = &self.tray_events { if let Some(rx) = &self.tray_events {
loop { while let Ok(event) = rx.try_recv() {
match rx.try_recv() { tray_events.push(event);
Ok(event) => tray_events.push(event),
Err(_) => break,
}
} }
} }
for event in tray_events { for event in tray_events {
@@ -764,7 +759,7 @@ pub fn demo_review(app: &mut App) {
app.screen = Screen::Review; app.screen = Screen::Review;
app.review.game = app.games.first().map(|game| game.recording_id.clone()); app.review.game = app.games.first().map(|game| game.recording_id.clone());
app.review.error = Some("Sample recording: no clip on disk.".to_string()); app.review.error = Some("Sample recording: no clip on disk.".to_string());
if let Some(game) = app.games.get(0) { if let Some(game) = app.games.first() {
app.review.highlights = app.review.highlights =
crate::highlight::compute(game, game.summoner().as_deref(), Default::default()); crate::highlight::compute(game, game.summoner().as_deref(), Default::default());
app.review.duration = game.duration_secs.max(0) as f64; app.review.duration = game.duration_secs.max(0) as f64;
-2
View File
@@ -106,8 +106,6 @@ pub fn spawn() -> Result<PathBuf, String> {
Ok(binary) Ok(binary)
} }
/// Is a daemon answering on the pipe?
/// Wait up to `timeout` for the daemon to answer, starting it if it isn't running yet. /// Wait up to `timeout` for the daemon to answer, starting it if it isn't running yet.
pub async fn ensure_running() -> Result<(), String> { pub async fn ensure_running() -> Result<(), String> {
let client = Client::new(); let client = Client::new();
+1 -1
View File
@@ -172,7 +172,7 @@ pub fn load_all() -> Vec<Timeline> {
}); });
let mut out = parsed.into_inner().unwrap(); let mut out = parsed.into_inner().unwrap();
out.sort_by(|a, b| b.start_time.cmp(&a.start_time)); out.sort_by_key(|timeline| std::cmp::Reverse(timeline.start_time));
out out
} }
+11 -10
View File
@@ -100,17 +100,18 @@ pub fn tick(app: &mut App, tx: &mut Tx) -> bool {
app.review.time = time; app.review.time = time;
changed = true; changed = true;
} }
if let Some(duration) = player.duration() { if let Some(duration) = player.duration()
if duration > 0.0 && (duration - app.review.duration).abs() > 0.05 { && duration > 0.0
app.review.duration = duration; && (duration - app.review.duration).abs() > 0.05
changed = true; {
} app.review.duration = duration;
changed = true;
} }
if app.review.error.is_none() { if app.review.error.is_none()
if let rune::PlayerState::Failed(message) = player.state() { && let rune::PlayerState::Failed(message) = player.state()
app.review.error = Some(message); {
changed = true; app.review.error = Some(message);
} changed = true;
} }
if player.is_playing() { if player.is_playing() {
tx.wake_after(std::time::Duration::from_millis(33)); tx.wake_after(std::time::Duration::from_millis(33));
+4 -4
View File
@@ -73,7 +73,7 @@ impl Form {
} }
/// Pull the text fields into the draft and hand it to `updateSettings`. /// Pull the text fields into the draft and hand it to `updateSettings`.
pub fn to_settings(&mut self) -> Settings { pub fn settings(&mut self) -> Settings {
let mut out = self.draft.clone(); let mut out = self.draft.clone();
out.output.path = self.path.text.trim().to_string(); out.output.path = self.path.text.trim().to_string();
out.output.naming_pattern = self.naming.text.trim().to_string(); out.output.naming_pattern = self.naming.text.trim().to_string();
@@ -170,7 +170,7 @@ fn text_row(
) )
} }
/// A row with a dropdown on the right. #[allow(clippy::too_many_arguments)] // the columns of a settings row
fn select_row( fn select_row(
p: Paint, p: Paint,
kit: &rune_kit::Kit, kit: &rune_kit::Kit,
@@ -270,7 +270,7 @@ pub fn view(app: &App, p: Paint) -> El {
text(save_label(app)) text(save_label(app))
.key("save-label") .key("save-label")
.font(body(11.5)) .font(body(11.5))
.color(if app.form.dirty { p.muted() } else { p.muted() }), .color(p.muted()),
), ),
) )
.child(ui::button(p, "revert", "Revert", false, |app: &mut App| { .child(ui::button(p, "revert", "Revert", false, |app: &mut App| {
@@ -283,7 +283,7 @@ pub fn view(app: &App, p: Paint) -> El {
if !app.form.loaded { if !app.form.loaded {
return; return;
} }
let settings = app.form.to_settings(); let settings = app.form.settings();
match serde_json::to_value(&settings) { match serde_json::to_value(&settings) {
Ok(value) => app.daemon.save_settings(value), Ok(value) => app.daemon.save_settings(value),
Err(e) => { Err(e) => {
+4 -14
View File
@@ -124,35 +124,25 @@ impl EncoderPreset {
} }
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum AmfQuality { pub enum AmfQuality {
Speed, Speed,
#[default]
Balanced, Balanced,
Quality, Quality,
} }
impl Default for AmfQuality { #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
fn default() -> Self {
Self::Balanced
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum Quality { pub enum Quality {
Low, Low,
Medium, Medium,
#[default]
High, High,
Ultra, Ultra,
} }
impl Default for Quality {
fn default() -> Self {
Self::High
}
}
impl Quality { impl Quality {
pub fn label(self) -> &'static str { pub fn label(self) -> &'static str {
match self { match self {
+2
View File
@@ -100,6 +100,8 @@
#![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))] #![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))]
// END LINEBENDER LINT SET // END LINEBENDER LINT SET
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
// Vendored: the upstream crate has an unreachable expression rustc warns about; keep the build log quiet.
#![allow(unreachable_code)]
#![no_std] #![no_std]
#[cfg(feature = "std")] #[cfg(feature = "std")]
extern crate std; extern crate std;
+1 -2
View File
@@ -234,8 +234,7 @@
trivial_casts, trivial_casts,
trivial_numeric_casts, trivial_numeric_casts,
unsafe_op_in_unsafe_fn, unsafe_op_in_unsafe_fn,
unused_extern_crates, unused_extern_crates
unused_qualifications
)] )]
extern crate alloc; extern crate alloc;