Skip to content

Commit b58c5d5

Browse files
fix v1
1 parent 936eab2 commit b58c5d5

File tree

20 files changed

+41
-54
lines changed

20 files changed

+41
-54
lines changed

relay-config/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2247,7 +2247,7 @@ impl Config {
22472247
}
22482248

22492249
let file_name = path.file_name().and_then(|f| f.to_str())?;
2250-
let new_file_name = format!("{}.{}", file_name, partition_id);
2250+
let new_file_name = format!("{file_name}.{partition_id}");
22512251
path.set_file_name(new_file_name);
22522252

22532253
Some(path)

relay-event-normalization/src/normalize/contexts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn normalize_runtime_context(runtime: &mut RuntimeContext) {
145145
// The equivalent calculation is done in `sentry` in `src/sentry/interfaces/contexts.py`.
146146
if runtime.runtime.value().is_none() {
147147
if let (Some(name), Some(version)) = (runtime.name.value(), runtime.version.value()) {
148-
runtime.runtime = Annotated::from(format!("{} {}", name, version));
148+
runtime.runtime = Annotated::from(format!("{name} {version}"));
149149
}
150150
}
151151
}
@@ -270,7 +270,7 @@ fn compute_os_context(os: &mut OsContext) {
270270
// The equivalent calculation is done in `sentry` in `src/sentry/interfaces/contexts.py`.
271271
if os.os.value().is_none() {
272272
if let (Some(name), Some(version)) = (os.name.value(), os.version.value()) {
273-
os.os = Annotated::from(format!("{} {}", name, version));
273+
os.os = Annotated::from(format!("{name} {version}"));
274274
}
275275
}
276276
}
@@ -280,7 +280,7 @@ fn normalize_browser_context(browser: &mut BrowserContext) {
280280
// The equivalent calculation is done in `sentry` in `src/sentry/interfaces/contexts.py`.
281281
if browser.browser.value().is_none() {
282282
if let (Some(name), Some(version)) = (browser.name.value(), browser.version.value()) {
283-
browser.browser = Annotated::from(format!("{} {}", name, version));
283+
browser.browser = Annotated::from(format!("{name} {version}"));
284284
}
285285
}
286286
}

relay-event-normalization/src/normalize/span/description/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,15 +1415,14 @@ mod tests {
14151415
for (url, allowed_hosts, expected) in examples {
14161416
let json = format!(
14171417
r#"{{
1418-
"description": "POST {}",
1418+
"description": "POST {url}",
14191419
"span_id": "bd2eb23da2beb459",
14201420
"start_timestamp": 1597976393.4619668,
14211421
"timestamp": 1597976393.4718769,
14221422
"trace_id": "ff62a8b040f340bda5d830223def1d81",
14231423
"op": "http.client"
14241424
}}
14251425
"#,
1426-
url,
14271426
);
14281427

14291428
let mut span = Annotated::<Span>::from_json(&json).unwrap();
@@ -1433,7 +1432,7 @@ mod tests {
14331432

14341433
assert_eq!(
14351434
scrubbed.0.as_deref(),
1436-
Some(format!("POST {}", expected).as_str()),
1435+
Some(format!("POST {expected}").as_str()),
14371436
"Could not match {url}"
14381437
);
14391438
}

relay-event-normalization/src/timestamp.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,15 @@ impl Processor for TimestampProcessor {
5353
if let Some(start_timestamp) = span.start_timestamp.value() {
5454
if start_timestamp.into_inner().timestamp_millis() < 0 {
5555
meta.add_error(Error::invalid(format!(
56-
"start_timestamp is too stale: {}",
57-
start_timestamp
56+
"start_timestamp is too stale: {start_timestamp}"
5857
)));
5958
return Err(ProcessingAction::DeleteValueHard);
6059
}
6160
}
6261
if let Some(end_timestamp) = span.timestamp.value() {
6362
if end_timestamp.into_inner().timestamp_millis() < 0 {
6463
meta.add_error(Error::invalid(format!(
65-
"timestamp is too stale: {}",
66-
end_timestamp
64+
"timestamp is too stale: {end_timestamp}"
6765
)));
6866
return Err(ProcessingAction::DeleteValueHard);
6967
}
@@ -81,8 +79,7 @@ impl Processor for TimestampProcessor {
8179
if let Some(timestamp) = breadcrumb.timestamp.value() {
8280
if timestamp.into_inner().timestamp_millis() < 0 {
8381
meta.add_error(Error::invalid(format!(
84-
"timestamp is too stale: {}",
85-
timestamp
82+
"timestamp is too stale: {timestamp}"
8683
)));
8784
return Err(ProcessingAction::DeleteValueHard);
8885
}

relay-filter/src/transaction_name.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ mod tests {
247247
assert_eq!(
248248
filter_result,
249249
Ok(()),
250-
"Event filtered for event_type={} although filter should have not matched",
251-
event_type
250+
"Event filtered for event_type={event_type} although filter should have not matched"
252251
)
253252
}
254253
}

relay-log/src/setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Level {
126126

127127
impl Display for Level {
128128
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
129-
write!(f, "{}", format!("{:?}", self).to_lowercase())
129+
write!(f, "{}", format!("{self:?}").to_lowercase())
130130
}
131131
}
132132

relay-profiling/src/sample/v2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ mod tests {
221221
fn test_roundtrip() {
222222
let first_payload = include_bytes!("../../tests/fixtures/sample/v2/valid.json");
223223
let first_parse = parse(first_payload);
224-
assert!(first_parse.is_ok(), "{:#?}", first_parse);
224+
assert!(first_parse.is_ok(), "{first_parse:#?}");
225225
let second_payload = serde_json::to_vec(&first_parse.unwrap()).unwrap();
226226
let second_parse = parse(&second_payload[..]);
227-
assert!(second_parse.is_ok(), "{:#?}", second_parse);
227+
assert!(second_parse.is_ok(), "{second_parse:#?}");
228228
}
229229

230230
#[test]

relay-profiling/src/utils.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ where
3131
AnyType::String(s) => s.parse::<T>().map_err(serde::de::Error::custom),
3232
AnyType::Number(n) => Ok(n),
3333
AnyType::Bool(v) => Err(serde::de::Error::custom(format!(
34-
"unsupported value: {:?}",
35-
v
34+
"unsupported value: {v:?}"
3635
))),
3736
AnyType::Array(v) => Err(serde::de::Error::custom(format!(
38-
"unsupported value: {:?}",
39-
v
37+
"unsupported value: {v:?}"
4038
))),
4139
AnyType::Object(v) => Err(serde::de::Error::custom(format!(
42-
"unsupported value: {:?}",
43-
v
40+
"unsupported value: {v:?}"
4441
))),
4542
AnyType::Null => Err(serde::de::Error::custom("unsupported null value")),
4643
}

relay-prosperoconv/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn main() {
4040
"clone",
4141
"[email protected]:getsentry/tempest.git",
4242
&temp_dir_str,
43-
&format!("--revision={}", version),
43+
&format!("--revision={version}"),
4444
"--depth=1",
4545
])
4646
.status()
@@ -52,7 +52,7 @@ fn main() {
5252
"clone",
5353
"https://github.com/getsentry/tempest.git",
5454
&temp_dir_str,
55-
&format!("--revision={}", version),
55+
&format!("--revision={version}"),
5656
"--depth=1",
5757
])
5858
.status()

relay-quotas/src/redis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ mod tests {
493493
scope_id: None,
494494
limit: Some(quota_limit),
495495
window: Some(600),
496-
reason_code: Some(ReasonCode::new(format!("ns: {:?}", namespace))),
496+
reason_code: Some(ReasonCode::new(format!("ns: {namespace:?}"))),
497497
namespace,
498498
}
499499
};

0 commit comments

Comments
 (0)