Skip to content

Commit

Permalink
chore: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Dec 6, 2024
1 parent 071da49 commit 6ed0a5d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/ipc/discord/client.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::ipc::discord::utils;
use crate::json::serialize::Serialize;
use crate::json::Json;
use crate::presence::types::{Activity, Packet};
use std::io::{self, Read, Write};
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/discord/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl Connection for RichClient {
}
Err(e) => match e.kind() {
io::ErrorKind::NotFound => continue,
_ => return Err(e.into()),
_ => return Err(e),
},
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/pipe/platform/unix/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::ipc::pipe::PipeClientImpl;
use crate::local_event;
use crate::messages::events::client::ClientEvent;
use crate::messages::events::event::Event;
use crate::messages::events::local::{ClientDisconnectedEvent, ErrorEvent};
use crate::messages::events::local::ErrorEvent;
use crate::messages::message::Message;

pub struct PipeClient {
Expand Down Expand Up @@ -48,7 +48,7 @@ impl PipeClientImpl for PipeClient {
let mut buf = [0u8; 4096];
loop {
match read_pipe.read(&mut buf) {
Ok(n) if n == 0 => {
Ok(0) => {
tx.send(local_event!(id, ClientDisconnected)).ok();
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/pipe/platform/unix/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl PipeServerImpl for PipeServer {
let mut failed_clients = Vec::new();

for (client_id, client) in clients.iter_mut() {
if let Err(_) = client.write(data) {
if client.write(data).is_err() {
failed_clients.push(*client_id);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/pipe/platform/windows/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl PipeClientImpl for PipeClient {
let mut buf = [0u8; 4096];
loop {
match pipe.read(&mut buf) {
Ok(n) if n == 0 => {
Ok(0) => {
tx.send(local_event!(id, ClientDisconnected)).ok();
break;
}
Expand Down
4 changes: 3 additions & 1 deletion src/ipc/pipe/platform/windows/server.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::upper_case_acronyms)]

use std::collections::HashMap;
use std::fs::File;
use std::io;
Expand Down Expand Up @@ -126,7 +128,7 @@ impl PipeServerImpl for PipeServer {
let mut failed_clients = Vec::new();

for (client_id, client) in clients.iter_mut() {
if let Err(_) = client.write(data) {
if client.write(data).is_err() {
failed_clients.push(*client_id);
}
}
Expand Down

0 comments on commit 6ed0a5d

Please sign in to comment.