Skip to content

Commit 29b0903

Browse files
authored
chore: appease clippy (#300)
1 parent b71209f commit 29b0903

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+120
-125
lines changed

src/config/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ mod tests {
172172
ENV.set("HOME".to_string(), "/home/u123".to_string());
173173
if let Some(host) = host {
174174
ENV.set("MPD_HOST".to_string(), host.to_string());
175-
};
175+
}
176176
if let Some(port) = port {
177177
ENV.set("MPD_PORT".to_string(), port.to_string());
178178
}

src/config/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl ConfigFile {
362362
let is_tmux = tmux::is_inside_tmux();
363363
if is_tmux && !tmux::is_passthrough_enabled()? {
364364
tmux::enable_passthrough()?;
365-
};
365+
}
366366

367367
config.album_art.method = match self.image_method.unwrap_or(album_art_method) {
368368
ImageMethodFile::Iterm2 => ImageMethod::Iterm2,

src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl AppContext {
193193

194194
if let Ok(Some(lrc)) = self.lrc_index.find_lrc_for_song(song) {
195195
return Ok(Some(lrc));
196-
};
196+
}
197197

198198
Ok(None)
199199
}

src/core/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl Command {
5353
Some(current_id) if current_id > job_id => {
5454
break;
5555
}
56-
Some(_id) => continue,
56+
Some(_id) => {}
5757
None => break,
5858
}
5959
}

src/core/event_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ fn main_task<B: Backend + std::io::Write>(
431431
.draw(|frame| {
432432
if let Err(err) = ui.render(frame, &mut context) {
433433
log::error!(error:? = err; "Failed to render a frame");
434-
};
434+
}
435435
})
436436
.expect("Expected render to succeed");
437437

@@ -491,7 +491,7 @@ fn handle_idle_event(event: IdleEvent, context: &AppContext, result_ui_evs: &mut
491491
| IdleEvent::Mount => {
492492
log::warn!(event:?; "Received unhandled event");
493493
}
494-
};
494+
}
495495

496496
if let Ok(ev) = event.try_into() {
497497
result_ui_evs.insert(ev);

src/core/input.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ fn input_poll_task(event_tx: &Sender<AppEvent>) {
3636
}
3737
Err(err) => {
3838
log::warn!(error:? = err; "Failed to read input event");
39-
continue;
4039
}
4140
},
4241
Ok(_) => {}

src/core/scheduler/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ where
115115
_ => {}
116116
},
117117
_ => {}
118-
};
118+
}
119119

120120
duration =
121121
jobs.peek().map(|Reverse(job)| job.run_at().saturating_duration_since(now));
@@ -441,7 +441,7 @@ mod tests {
441441

442442
scheduler.start();
443443

444-
while results.lock().unwrap().len() < 1 {
444+
while results.lock().unwrap().is_empty() {
445445
std::thread::sleep(Duration::from_millis(10));
446446
}
447447
std::thread::sleep(Duration::from_millis(200));

src/core/socket.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::{
1616
ipc::{SocketCommand, SocketCommandExecute, get_socket_path},
1717
macros::try_cont,
1818
},
19+
try_skip,
1920
};
2021

2122
pub(crate) fn init(
@@ -39,7 +40,7 @@ pub(crate) fn init(
3940
try_cont!(serde_json::from_str(&buf), "Failed to parse socket command");
4041

4142
log::debug!(command:?, addr:?; "Got command from unix socket");
42-
try_cont!(
43+
try_skip!(
4344
command.execute(&event_tx, &work_tx, &config),
4445
"Socket command execution failed"
4546
);

src/mpd/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'name> Client<'name> {
121121
rx.read_line(&mut buf)?;
122122
if !buf.starts_with("OK") {
123123
return Err(MpdError::Generic(format!("Handshake validation failed. '{buf}'")));
124-
};
124+
}
125125
let Some(version): Option<Version> =
126126
buf.strip_prefix("OK MPD ").and_then(|v| v.parse().ok())
127127
else {
@@ -166,7 +166,7 @@ impl<'name> Client<'name> {
166166
rx.read_line(&mut buf)?;
167167
if !buf.starts_with("OK") {
168168
return Err(MpdError::Generic(format!("Handshake validation failed. '{buf}'")));
169-
};
169+
}
170170

171171
let Some(version): Option<Version> =
172172
buf.strip_prefix("OK MPD ").and_then(|v| v.parse().ok())

src/mpd/commands/idle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl FromMpd for Vec<IdleEvent> {
4545
"neighbor" => self.push(IdleEvent::Neighbor),
4646
"mount" => self.push(IdleEvent::Mount),
4747
_ => return Ok(LineHandled::No { value }),
48-
};
48+
}
4949
Ok(LineHandled::Yes)
5050
}
5151
}

0 commit comments

Comments
 (0)