Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Apr 20, 2024
1 parent fa1b4fe commit 674e261
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/bin/rbw-agent/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ pub async fn lock(
pub async fn check_lock(
sock: &mut crate::sock::Sock,
state: std::sync::Arc<tokio::sync::Mutex<crate::agent::State>>,
_tty: Option<&str>,
) -> anyhow::Result<()> {
if state.lock().await.needs_unlock() {
return Err(anyhow::anyhow!("agent is locked"));
Expand Down
7 changes: 1 addition & 6 deletions src/bin/rbw-agent/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
8 changes: 2 additions & 6 deletions src/bin/rbw/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,7 @@ impl DecryptedUri {
}

fn host_port(url: &Url) -> Option<String> {
let Some(host) = url.host_str() else {
return None;
};
let host = url.host_str()?;
Some(
url.port().map_or_else(
|| host.to_string(),
Expand All @@ -772,9 +770,7 @@ fn host_port(url: &Url) -> Option<String> {
}

fn domain_port(url: &Url) -> Option<String> {
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}"),
Expand Down

0 comments on commit 674e261

Please sign in to comment.