Skip to content

Commit 896ea70

Browse files
style: apply cargo fmt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4bfca5a commit 896ea70

6 files changed

Lines changed: 63 additions & 22 deletions

File tree

src/commands/cicd.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ pub async fn pipelines_list(
4747
query_parts.push(format!("@git.branch:\"{}\"", b.replace('"', "\\\"")));
4848
}
4949
if let Some(p) = pipeline_name {
50-
query_parts.push(format!(
51-
"@ci.pipeline.name:\"{}\"",
52-
p.replace('"', "\\\"")
53-
));
50+
query_parts.push(format!("@ci.pipeline.name:\"{}\"", p.replace('"', "\\\"")));
5451
}
5552

5653
let mut filter = CIAppPipelinesQueryFilter::new().from(from_str).to(to_str);
@@ -387,9 +384,15 @@ mod tests {
387384
#[tokio::test]
388385
async fn test_cicd_events_search_invalid_sort() {
389386
let cfg = test_config("http://unused.local");
390-
let result =
391-
super::events_search(&cfg, "*".into(), "1h".into(), "now".into(), 10, "bogus".into())
392-
.await;
387+
let result = super::events_search(
388+
&cfg,
389+
"*".into(),
390+
"1h".into(),
391+
"now".into(),
392+
10,
393+
"bogus".into(),
394+
)
395+
.await;
393396
assert!(result.is_err());
394397
assert!(result
395398
.unwrap_err()

src/commands/on_call.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ pub(crate) async fn resolve_team_id(cfg: &Config, input: &str) -> Result<String>
5858
.await
5959
.map_err(|e| anyhow::anyhow!("failed to resolve team handle '{input}': {e:?}"))?;
6060

61-
let teams = resp
62-
.data
63-
.ok_or_else(|| anyhow::anyhow!("unexpected response from teams API: 'data' field missing"))?;
61+
let teams = resp.data.ok_or_else(|| {
62+
anyhow::anyhow!("unexpected response from teams API: 'data' field missing")
63+
})?;
6464
let total = teams.len();
6565
let exact: Vec<&datadog_api_client::datadogV2::model::Team> = teams
6666
.iter()
@@ -880,7 +880,11 @@ mod tests {
880880
let team_uuid = "00000000-0000-0000-0000-000000000001";
881881
mock_all(&mut s, r#"{"data": []}"#).await;
882882
let result = super::memberships_list(&cfg, team_uuid, 10, 0, "name".into()).await;
883-
assert!(result.is_ok(), "memberships_list failed: {:?}", result.err());
883+
assert!(
884+
result.is_ok(),
885+
"memberships_list failed: {:?}",
886+
result.err()
887+
);
884888
cleanup_env();
885889
}
886890

src/commands/rum.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,12 @@ mod tests {
548548
let mut s = mockito::Server::new_async().await;
549549
let cfg = test_config(&s.url());
550550
mock_all(&mut s, r#"{"data": []}"#).await;
551-
let result =
552-
super::sessions_search(&cfg, None, "1h".into(), "now".into(), 25).await;
553-
assert!(result.is_ok(), "rum sessions search failed: {:?}", result.err());
551+
let result = super::sessions_search(&cfg, None, "1h".into(), "now".into(), 25).await;
552+
assert!(
553+
result.is_ok(),
554+
"rum sessions search failed: {:?}",
555+
result.err()
556+
);
554557
cleanup_env();
555558
}
556559
}

src/commands/security.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,15 @@ mod tests {
10841084
#[tokio::test]
10851085
async fn test_signals_search_invalid_sort() {
10861086
let cfg = test_config("http://unused.local");
1087-
let result =
1088-
super::signals_search(&cfg, "*".into(), "1h".into(), "now".into(), 10, Some("invalid".into()))
1089-
.await;
1087+
let result = super::signals_search(
1088+
&cfg,
1089+
"*".into(),
1090+
"1h".into(),
1091+
"now".into(),
1092+
10,
1093+
Some("invalid".into()),
1094+
)
1095+
.await;
10901096
assert!(result.is_err());
10911097
assert!(result
10921098
.unwrap_err()

src/commands/traces.rs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,38 @@ mod tests {
446446
#[tokio::test]
447447
async fn test_search_limit_too_small() {
448448
let cfg = test_config("http://unused.local");
449-
let result = super::search(&cfg, "*".into(), "1h".into(), "now".into(), 0, "-timestamp".into()).await;
449+
let result = super::search(
450+
&cfg,
451+
"*".into(),
452+
"1h".into(),
453+
"now".into(),
454+
0,
455+
"-timestamp".into(),
456+
)
457+
.await;
450458
assert!(result.is_err());
451-
assert!(result.unwrap_err().to_string().contains("--limit must be between 1 and 1000"));
459+
assert!(result
460+
.unwrap_err()
461+
.to_string()
462+
.contains("--limit must be between 1 and 1000"));
452463
}
453464

454465
#[tokio::test]
455466
async fn test_search_limit_too_large() {
456467
let cfg = test_config("http://unused.local");
457-
let result = super::search(&cfg, "*".into(), "1h".into(), "now".into(), 1001, "-timestamp".into()).await;
468+
let result = super::search(
469+
&cfg,
470+
"*".into(),
471+
"1h".into(),
472+
"now".into(),
473+
1001,
474+
"-timestamp".into(),
475+
)
476+
.await;
458477
assert!(result.is_err());
459-
assert!(result.unwrap_err().to_string().contains("--limit must be between 1 and 1000"));
478+
assert!(result
479+
.unwrap_err()
480+
.to_string()
481+
.contains("--limit must be between 1 and 1000"));
460482
}
461483
}

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4664,7 +4664,10 @@ enum SecuritySignalActions {
46644664
to: String,
46654665
#[arg(long, default_value_t = 100, help = "Maximum results (1-1000)")]
46664666
limit: i32,
4667-
#[arg(long, help = "Sort order: timestamp (ascending) or -timestamp (descending)")]
4667+
#[arg(
4668+
long,
4669+
help = "Sort order: timestamp (ascending) or -timestamp (descending)"
4670+
)]
46684671
sort: Option<String>,
46694672
},
46704673
/// Get log queries for investigating a signal

0 commit comments

Comments
 (0)