From 674e261df7b8d22e957224507b717c34c60a6135 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 20 Apr 2024 16:03:23 -0400 Subject: clippy --- src/bin/rbw-agent/actions.rs | 1 - src/bin/rbw-agent/agent.rs | 7 +------ src/bin/rbw/commands.rs | 8 ++------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/bin/rbw-agent/actions.rs b/src/bin/rbw-agent/actions.rs index ff39510..674442b 100644 --- a/src/bin/rbw-agent/actions.rs +++ b/src/bin/rbw-agent/actions.rs @@ -474,7 +474,6 @@ pub async fn lock( pub async fn check_lock( sock: &mut crate::sock::Sock, state: std::sync::Arc>, - _tty: Option<&str>, ) -> anyhow::Result<()> { if state.lock().await.needs_unlock() { return Err(anyhow::anyhow!("agent is locked")); diff --git a/src/bin/rbw-agent/agent.rs b/src/bin/rbw-agent/agent.rs index 1345967..a3fecb4 100644 --- a/src/bin/rbw-agent/agent.rs +++ b/src/bin/rbw-agent/agent.rs @@ -209,12 +209,7 @@ async fn handle_request( true } rbw::protocol::Action::CheckLock => { - crate::actions::check_lock( - sock, - state.clone(), - req.tty.as_deref(), - ) - .await?; + crate::actions::check_lock(sock, state.clone()).await?; false } rbw::protocol::Action::Lock => { diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index 703a351..fce2d15 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -760,9 +760,7 @@ impl DecryptedUri { } fn host_port(url: &Url) -> Option { - let Some(host) = url.host_str() else { - return None; - }; + let host = url.host_str()?; Some( url.port().map_or_else( || host.to_string(), @@ -772,9 +770,7 @@ fn host_port(url: &Url) -> Option { } fn domain_port(url: &Url) -> Option { - let Some(domain) = url.domain() else { - return None; - }; + let domain = url.domain()?; Some(url.port().map_or_else( || domain.to_string(), |port| format!("{domain}:{port}"), -- cgit v1.2.3-54-g00ecf