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:
1 parent
744aa20496
commit
01a92f1edf
8 files changed
+31
-46
No files matched your search
+8
-13
@@ -49,7 +49,7 @@ impl Status {
|
||||
"recording" => "Recording".to_string(),
|
||||
"error" => "Error".to_string(),
|
||||
"shutting_down" => "Shutting down".to_string(),
|
||||
other if other.is_empty() => "Unknown".to_string(),
|
||||
"" => "Unknown".to_string(),
|
||||
other => other.to_string(),
|
||||
}
|
||||
}
|
||||
@@ -392,12 +392,10 @@ impl App {
|
||||
self.notify_error(format!("Status did not parse: {e}"));
|
||||
}
|
||||
},
|
||||
(ipc::Request::Status, Err(e)) => {
|
||||
if self.connected {
|
||||
self.connected = false;
|
||||
self.notify_error(format!("Lost the record-daemon: {e}"));
|
||||
self.refresh_games();
|
||||
}
|
||||
(ipc::Request::Status, Err(e)) if self.connected => {
|
||||
self.connected = false;
|
||||
self.notify_error(format!("Lost the record-daemon: {e}"));
|
||||
self.refresh_games();
|
||||
}
|
||||
(ipc::Request::Encoders, Ok(data)) => {
|
||||
if let Ok(list) = serde_json::from_value(data) {
|
||||
@@ -451,11 +449,8 @@ impl App {
|
||||
|
||||
let mut tray_events = Vec::new();
|
||||
if let Some(rx) = &self.tray_events {
|
||||
loop {
|
||||
match rx.try_recv() {
|
||||
Ok(event) => tray_events.push(event),
|
||||
Err(_) => break,
|
||||
}
|
||||
while let Ok(event) = rx.try_recv() {
|
||||
tray_events.push(event);
|
||||
}
|
||||
}
|
||||
for event in tray_events {
|
||||
@@ -764,7 +759,7 @@ pub fn demo_review(app: &mut App) {
|
||||
app.screen = Screen::Review;
|
||||
app.review.game = app.games.first().map(|game| game.recording_id.clone());
|
||||
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 =
|
||||
crate::highlight::compute(game, game.summoner().as_deref(), Default::default());
|
||||
app.review.duration = game.duration_secs.max(0) as f64;
|
||||
|
||||
@@ -106,8 +106,6 @@ pub fn spawn() -> Result<PathBuf, String> {
|
||||
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.
|
||||
pub async fn ensure_running() -> Result<(), String> {
|
||||
let client = Client::new();
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ pub fn load_all() -> Vec<Timeline> {
|
||||
});
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
+11
-10
@@ -100,17 +100,18 @@ pub fn tick(app: &mut App, tx: &mut Tx) -> bool {
|
||||
app.review.time = time;
|
||||
changed = true;
|
||||
}
|
||||
if let Some(duration) = player.duration() {
|
||||
if duration > 0.0 && (duration - app.review.duration).abs() > 0.05 {
|
||||
app.review.duration = duration;
|
||||
changed = true;
|
||||
}
|
||||
if let Some(duration) = player.duration()
|
||||
&& duration > 0.0
|
||||
&& (duration - app.review.duration).abs() > 0.05
|
||||
{
|
||||
app.review.duration = duration;
|
||||
changed = true;
|
||||
}
|
||||
if app.review.error.is_none() {
|
||||
if let rune::PlayerState::Failed(message) = player.state() {
|
||||
app.review.error = Some(message);
|
||||
changed = true;
|
||||
}
|
||||
if app.review.error.is_none()
|
||||
&& let rune::PlayerState::Failed(message) = player.state()
|
||||
{
|
||||
app.review.error = Some(message);
|
||||
changed = true;
|
||||
}
|
||||
if player.is_playing() {
|
||||
tx.wake_after(std::time::Duration::from_millis(33));
|
||||
|
||||
@@ -73,7 +73,7 @@ impl Form {
|
||||
}
|
||||
|
||||
/// 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();
|
||||
out.output.path = self.path.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(
|
||||
p: Paint,
|
||||
kit: &rune_kit::Kit,
|
||||
@@ -270,7 +270,7 @@ pub fn view(app: &App, p: Paint) -> El {
|
||||
text(save_label(app))
|
||||
.key("save-label")
|
||||
.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| {
|
||||
@@ -283,7 +283,7 @@ pub fn view(app: &App, p: Paint) -> El {
|
||||
if !app.form.loaded {
|
||||
return;
|
||||
}
|
||||
let settings = app.form.to_settings();
|
||||
let settings = app.form.settings();
|
||||
match serde_json::to_value(&settings) {
|
||||
Ok(value) => app.daemon.save_settings(value),
|
||||
Err(e) => {
|
||||
|
||||
+4
-14
@@ -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")]
|
||||
pub enum AmfQuality {
|
||||
Speed,
|
||||
#[default]
|
||||
Balanced,
|
||||
Quality,
|
||||
}
|
||||
|
||||
impl Default for AmfQuality {
|
||||
fn default() -> Self {
|
||||
Self::Balanced
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum Quality {
|
||||
Low,
|
||||
Medium,
|
||||
#[default]
|
||||
High,
|
||||
Ultra,
|
||||
}
|
||||
|
||||
impl Default for Quality {
|
||||
fn default() -> Self {
|
||||
Self::High
|
||||
}
|
||||
}
|
||||
|
||||
impl Quality {
|
||||
pub fn label(self) -> &'static str {
|
||||
match self {
|
||||
|
||||
Vendored
+2
@@ -100,6 +100,8 @@
|
||||
#![cfg_attr(target_pointer_width = "64", warn(clippy::trivially_copy_pass_by_ref))]
|
||||
// END LINEBENDER LINT SET
|
||||
#![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]
|
||||
#[cfg(feature = "std")]
|
||||
extern crate std;
|
||||
|
||||
Vendored
+1
-2
@@ -234,8 +234,7 @@
|
||||
trivial_casts,
|
||||
trivial_numeric_casts,
|
||||
unsafe_op_in_unsafe_fn,
|
||||
unused_extern_crates,
|
||||
unused_qualifications
|
||||
unused_extern_crates
|
||||
)]
|
||||
|
||||
extern crate alloc;
|
||||
|
||||
Reference in new issue
Block a user