From 81e940a0e82e45debf49d1e693e5f14bee07a287 Mon Sep 17 00:00:00 2001 From: Daniel Szoke Date: Wed, 16 Jul 2025 16:12:44 +0200 Subject: [PATCH] ref: Apply `cargo fmt` to `src/commands` Previously, `cargo fmt` was unable to find these files, so CI could not enforce formatting. Fortunately, seems as though most contributors have been using rust-analyzer locally, so there are only a few formatter violations to fix here. --- src/commands/mobile_app/upload.rs | 15 ++++++++++----- src/commands/react_native/gradle.rs | 4 +--- src/commands/send_metric/mod.rs | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/commands/mobile_app/upload.rs b/src/commands/mobile_app/upload.rs index 91050cecdb..12de0fe033 100644 --- a/src/commands/mobile_app/upload.rs +++ b/src/commands/mobile_app/upload.rs @@ -1,10 +1,10 @@ use std::borrow::Cow; -use std::io::Write; -use std::path::Path; #[cfg(not(windows))] use std::fs; +use std::io::Write; #[cfg(not(windows))] use std::os::unix::fs::PermissionsExt; +use std::path::Path; use anyhow::{anyhow, bail, Context as _, Result}; use clap::{Arg, ArgAction, ArgMatches, Command}; @@ -256,9 +256,14 @@ fn normalize_directory(path: &Path) -> Result { .filter(|entry| entry.path().is_file()) .map(|entry| { let entry_path = entry.into_path(); - let relative_path = entry_path.strip_prefix( - path.parent().ok_or_else(|| anyhow!("Cannot determine parent directory for path: {}", path.display()))? - )?.to_owned(); + let relative_path = entry_path + .strip_prefix(path.parent().ok_or_else(|| { + anyhow!( + "Cannot determine parent directory for path: {}", + path.display() + ) + })?)? + .to_owned(); Ok((entry_path, relative_path)) }) .collect::>>()? diff --git a/src/commands/react_native/gradle.rs b/src/commands/react_native/gradle.rs index 013bc4d20c..9fb74ae171 100644 --- a/src/commands/react_native/gradle.rs +++ b/src/commands/react_native/gradle.rs @@ -119,9 +119,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> { if let Some(version) = version { for dist in matches.get_many::("dist").unwrap() { - println!( - "Uploading sourcemaps for release {version} distribution {dist}" - ); + println!("Uploading sourcemaps for release {version} distribution {dist}"); processor.upload(&UploadContext { org: &org, diff --git a/src/commands/send_metric/mod.rs b/src/commands/send_metric/mod.rs index 42f0513b1d..da19a1bc0e 100644 --- a/src/commands/send_metric/mod.rs +++ b/src/commands/send_metric/mod.rs @@ -38,7 +38,7 @@ This command will validate input parameters and attempt to send a metric to \ Sentry. Due to network errors and rate limits, the metric is not guaranteed to \ arrive. Check the debug output for transmission errors by passing --log-level=\ debug or setting `SENTRY_LOG_LEVEL=debug`."))] -#[command(hide=true)] +#[command(hide = true)] enum SendMetricSubcommand { #[command(about = format!("[DEPRECATED] {INCREMENT_ABOUT}"))] #[command(long_about = format!("{DEPRECATION_MESSAGE}{{n}}{{n}}{INCREMENT_ABOUT}"))]