Resolve clippy warnings

This commit is contained in:
timvisee
2024-03-16 12:50:25 +01:00
parent efb047114e
commit 6e6d098cf1
3 changed files with 4 additions and 4 deletions

View File

@@ -652,7 +652,7 @@ async fn drain_stream(reader: &mut ReadHalf<'_>) -> Result<(), ()> {
let mut drain_buf = [0; 8 * 1024];
loop {
match reader.try_read(&mut drain_buf) {
Ok(read) if read == 0 => return Ok(()),
Ok(0) => return Ok(()),
Err(err) if err.kind() == ErrorKind::WouldBlock => return Ok(()),
Ok(_) => continue,
Err(err) => {

View File

@@ -67,11 +67,11 @@ pub fn unfreeze(pid: u32) -> bool {
#[cfg(unix)]
pub fn unix_signal(pid: u32, signal: signal::Signal) -> bool {
return match signal::kill(Pid::from_raw(pid as i32), signal) {
match signal::kill(Pid::from_raw(pid as i32), signal) {
Ok(()) => true,
Err(err) => {
warn!(target: "lazymc", "Sending {signal} signal to server failed: {err}");
false
}
};
}
}

View File

@@ -25,7 +25,7 @@ pub fn service(config: Arc<Config>, server: Arc<Server>) {
};
// Keep watching
#[allow(clippy::blocks_in_if_conditions)]
#[allow(clippy::blocks_in_conditions)]
while {
// Update all files once
reload_bans(&config, &server, &dir.join(ban::FILE));