Skip to content

Commit

Permalink
Fixes some lints
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoPonzi committed Nov 2, 2024
1 parent f49bd51 commit cba5d40
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 59 deletions.
56 changes: 4 additions & 52 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions commands/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn unwrap_response(response: HorustMsgMessage) -> Option<Result<horust_msg_respo
horust_msg_response::Response::Error(error) => {
Some(Err(anyhow!("Error: {}", error.error_string)))
}
horust_msg_response::Response::StatusResponse(status) => Some(Ok(v)),
horust_msg_response::Response::StatusResponse(_status) => Some(Ok(v)),
};
}
None
Expand Down Expand Up @@ -62,10 +62,10 @@ impl ClientHandler {
info!("Client: received: {received:?}");
let response = unwrap_response(received).unwrap()?;
if let horust_msg_response::Response::StatusResponse(resp) = response {
return Ok((
Ok((
resp.service_name,
HorustMsgServiceStatus::from_i32(resp.service_status).unwrap(),
));
HorustMsgServiceStatus::try_from(resp.service_status).unwrap(),
))
} else {
bail!("Invalid response received: {:?}", response);
}
Expand Down
2 changes: 1 addition & 1 deletion commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::path::{Path, PathBuf};

/// socket_name should be the pid of the horust process.
pub fn get_path(socket_folder_path: &Path, horust_pid: i32) -> PathBuf {
socket_folder_path.join(format!("hourst-{horust_pid}.sock"))
socket_folder_path.join(format!("horust-{horust_pid}.sock"))
}

pub struct UdsConnectionHandler {
Expand Down
2 changes: 1 addition & 1 deletion commands/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait CommandsHandlerTrait {
}
Err(e) => {
let kind = e.kind();
if !matches!(ErrorKind::WouldBlock, kind) {
if !matches!(kind, ErrorKind::WouldBlock) {
error!("Error accepting connction: {e} - you might need to restart Horust.");
}
}
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion horustctl/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::path::PathBuf;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
struct HorustctlArgs {
/// Optional if only one horust is running in the system.
/// The pid of the horust process you want to query. Optional if only one horust is running in the system.
#[arg(short, long)]
pid: Option<i32>,

Expand Down

0 comments on commit cba5d40

Please sign in to comment.