From eb26025a740888bb9cd9975cf18e8406bd9a50b7 Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Fri, 18 Sep 2026 10:58:45 +0200 Subject: [PATCH 1/2] Fix Clippy formatting borrow warnings --- linkup-cli/src/commands/infra/cloudflare/resources.rs | 4 ++-- linkup-cli/src/commands/start.rs | 2 +- linkup-cli/src/commands/stop.rs | 2 +- linkup-cli/src/commands/uninstall.rs | 2 +- linkup-cli/src/commands/update.rs | 8 ++++---- linkup-cli/src/release.rs | 2 +- local-server/src/certificates/mod.rs | 4 ++-- local-server/src/lib.rs | 6 +++--- worker/src/tunnel.rs | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/linkup-cli/src/commands/infra/cloudflare/resources.rs b/linkup-cli/src/commands/infra/cloudflare/resources.rs index aa56c9bb..a68e7ccf 100644 --- a/linkup-cli/src/commands/infra/cloudflare/resources.rs +++ b/linkup-cli/src/commands/infra/cloudflare/resources.rs @@ -958,13 +958,13 @@ impl TargetCfResources { Ok(_) => { notifier.notify(&format!( "Tunnel '{}' ({}) deleted", - &tunnel.name, &tunnel.id + tunnel.name, tunnel.id )); } Err(_) => { notifier.notify(&format!( "Failed to delete tunnel '{}' ({})", - &tunnel.name, &tunnel.id + tunnel.name, tunnel.id )); } } diff --git a/linkup-cli/src/commands/start.rs b/linkup-cli/src/commands/start.rs index e7841bd2..0fd1d7a3 100644 --- a/linkup-cli/src/commands/start.rs +++ b/linkup-cli/src/commands/start.rs @@ -97,7 +97,7 @@ fn set_service_env(directory: String, config_path: String) -> Result<()> { let service_path = PathBuf::from(config_dir).join(&directory); let dev_env_files: Vec<_> = fs::read_dir(&service_path) - .with_context(|| format!("Failed to read service directory {:?}", &service_path))? + .with_context(|| format!("Failed to read service directory {:?}", service_path))? .filter_map(Result::ok) .filter(|entry| { entry.file_name().to_string_lossy().ends_with(".linkup") diff --git a/linkup-cli/src/commands/stop.rs b/linkup-cli/src/commands/stop.rs index 311650e8..e88c44d1 100644 --- a/linkup-cli/src/commands/stop.rs +++ b/linkup-cli/src/commands/stop.rs @@ -50,7 +50,7 @@ fn remove_service_env(directory: String, config_path: String) -> Result<()> { let service_path = PathBuf::from(config_dir).join(&directory); let env_files: Vec<_> = fs::read_dir(&service_path) - .with_context(|| format!("Failed to read service directory {:?}", &service_path))? + .with_context(|| format!("Failed to read service directory {:?}", service_path))? .filter_map(Result::ok) .filter(|entry| entry.file_name().to_string_lossy().starts_with(".env")) .collect(); diff --git a/linkup-cli/src/commands/uninstall.rs b/linkup-cli/src/commands/uninstall.rs index f66d4374..b03dd0f5 100644 --- a/linkup-cli/src/commands/uninstall.rs +++ b/linkup-cli/src/commands/uninstall.rs @@ -30,7 +30,7 @@ pub async fn uninstall(_args: &Args, config_arg: Option<&Path>) -> Result<()> { let exe_path = linkup_exe_path()?; - log::debug!("Linkup exe path: {:?}", &exe_path); + log::debug!("Linkup exe path: {:?}", exe_path); match InstallationMethod::current()? { InstallationMethod::Brew => { log::debug!("Uninstalling linkup from Homebrew"); diff --git a/linkup-cli/src/commands/update.rs b/linkup-cli/src/commands/update.rs index 0b57a9b9..fb9ce0f3 100644 --- a/linkup-cli/src/commands/update.rs +++ b/linkup-cli/src/commands/update.rs @@ -50,10 +50,10 @@ pub async fn update(args: &Args) -> Result<()> { println!( "Updating from version '{}' ({}) to '{}' ({})...", - ¤t_version, - ¤t_version.channel(), - &update.version, - &update.version.channel() + current_version, + current_version.channel(), + update.version, + update.version.channel() ); let new_linkup_path = update diff --git a/linkup-cli/src/release.rs b/linkup-cli/src/release.rs index f7d44ee1..f7b80284 100644 --- a/linkup-cli/src/release.rs +++ b/linkup-cli/src/release.rs @@ -53,7 +53,7 @@ mod github { "Linkup release for OS '{}' and ARCH '{}' not found on version {}", lookup_os, arch, - &self.version + self.version ); } diff --git a/local-server/src/certificates/mod.rs b/local-server/src/certificates/mod.rs index 4a3c1f6f..a8b87aa3 100644 --- a/local-server/src/certificates/mod.rs +++ b/local-server/src/certificates/mod.rs @@ -153,8 +153,8 @@ pub fn create_domain_cert(certs_dir: &Path, domain: &str) -> (Certificate, KeyPa let cert = params.signed_by(&key_pair, &issuer).unwrap(); let escaped_domain = domain.replace("*", "wildcard_"); - let cert_path = certs_dir.join(format!("{}.cert.pem", &escaped_domain)); - let key_path = certs_dir.join(format!("{}.key.pem", &escaped_domain)); + let cert_path = certs_dir.join(format!("{}.cert.pem", escaped_domain)); + let key_path = certs_dir.join(format!("{}.key.pem", escaped_domain)); fs::write(cert_path, cert.pem()).unwrap(); fs::write(key_path, key_pair.serialize_pem()).unwrap(); diff --git a/local-server/src/lib.rs b/local-server/src/lib.rs index d53cab7d..23cb9cf1 100644 --- a/local-server/src/lib.rs +++ b/local-server/src/lib.rs @@ -104,7 +104,7 @@ async fn start_server_https(server_state: ServerState) { Err(error) => { eprintln!( "Failed to load certificates from {:?} into SNI: {}", - &server_state.https_certs_dir, error + server_state.https_certs_dir, error ); return; } @@ -118,7 +118,7 @@ async fn start_server_https(server_state: ServerState) { let app = router(server_state); let addr = SocketAddr::from(([0, 0, 0, 0], 443)); - println!("HTTPS listening on {}", &addr); + println!("HTTPS listening on {}", addr); axum_server::bind_rustls(addr, RustlsConfig::from_config(Arc::new(server_config))) .serve(app.into_make_service()) @@ -130,7 +130,7 @@ async fn start_server_http(server_state: ServerState) { let app = router(server_state); let addr = SocketAddr::from(([0, 0, 0, 0], 80)); - println!("HTTP listening on {}", &addr); + println!("HTTP listening on {}", addr); let listener = tokio::net::TcpListener::bind(addr) .await diff --git a/worker/src/tunnel.rs b/worker/src/tunnel.rs index a70af1ae..d57b036a 100644 --- a/worker/src/tunnel.rs +++ b/worker/src/tunnel.rs @@ -211,7 +211,7 @@ async fn create_tunnel( let tunnel_data = TunnelData { account_id: account_id.to_string(), name: tunnel_name.to_string(), - url: format!("https://{}.{}", &tunnel_name, &zone.name), + url: format!("https://{}.{}", tunnel_name, zone.name), id: tunnel.id.to_string(), secret: tunnel_secret, last_started: worker::Date::now().as_millis(), From 02f31610d4f6e7c506c434ec3e134f68d4e321b3 Mon Sep 17 00:00:00 2001 From: Oliver Stenbom Date: Fri, 18 Sep 2026 11:09:03 +0200 Subject: [PATCH 2/2] Fix Linux-specific Clippy warnings --- linkup-cli/src/commands/uninstall.rs | 2 +- linkup-cli/src/commands/update.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/linkup-cli/src/commands/uninstall.rs b/linkup-cli/src/commands/uninstall.rs index b03dd0f5..10f04eec 100644 --- a/linkup-cli/src/commands/uninstall.rs +++ b/linkup-cli/src/commands/uninstall.rs @@ -58,7 +58,7 @@ pub async fn uninstall(_args: &Args, config_arg: Option<&Path>) -> Result<()> { #[cfg(target_os = "linux")] { println!("Linkup needs sudo access to:"); - println!(" - Remove binary from {:?}", &exe_path); + println!(" - Remove binary from {:?}", exe_path); if !is_sudo() { sudo_su()?; diff --git a/linkup-cli/src/commands/update.rs b/linkup-cli/src/commands/update.rs index fb9ce0f3..8563e5b5 100644 --- a/linkup-cli/src/commands/update.rs +++ b/linkup-cli/src/commands/update.rs @@ -68,7 +68,7 @@ pub async fn update(args: &Args) -> Result<()> { #[cfg(target_os = "linux")] { println!("Linkup needs sudo access to:"); - println!(" - Update binary in {:?}", ¤t_linkup_path); + println!(" - Update binary in {:?}", current_linkup_path); println!(" - Add capability to bind to port 80/443"); if !is_sudo() {