Skip to content

Commit

Permalink
chore(backend): apply clippy suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaIng committed Jun 13, 2024
1 parent 64c67f1 commit b94a5de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/page_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub async fn process_handler(socket_send: &mut SocketSend, data_recv: &mut RecvC
tokio::select! {
biased;
data = data_recv.recv() => match data {
Some(Some(RequestTypes::Cmd { cmd, args: Some(args) })) => handle_error!(process_handler_helper(&cmd, args.get(0).map(String::as_str))),
Some(Some(RequestTypes::Cmd { cmd, args: Some(args) })) => handle_error!(process_handler_helper(&cmd, args.first().map(String::as_str))),
Some(Some(_)) => {}
_ => return false,
},
Expand Down Expand Up @@ -232,7 +232,7 @@ pub async fn service_handler(socket_send: &mut SocketSend, data_recv: &mut RecvC
args: Some(args),
} = data
{
if let Some(arg) = args.get(0) {
if let Some(arg) = args.first() {
handle_error!(Command::new("systemctl")
.args([&cmd, arg])
.spawn()
Expand Down Expand Up @@ -270,7 +270,7 @@ async fn browser_handler_helper(cmd: &str, args: &[String]) -> anyhow::Result<sh

tracing::debug!("Command is {}", cmd);

if let Some(arg) = args.get(0) {
if let Some(arg) = args.first() {
match cmd {
"cd" => {
return Ok(shared::BrowserList {
Expand Down
1 change: 1 addition & 0 deletions src/socket_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn validate_token(token: &str, fingerprint: Option<&str>) -> TokenState {
}

#[instrument(skip_all)]
#[allow(clippy::no_effect_underscore_binding)]
pub async fn socket_handler(
socket: tokio_tungstenite::WebSocketStream<hyper::upgrade::Upgraded>,
fingerprint: Option<String>,
Expand Down

0 comments on commit b94a5de

Please sign in to comment.