Skip to content

Commit d6a0f46

Browse files
Fix clippy errors
1 parent f541477 commit d6a0f46

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trace-normalization/src/normalize_utils.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn normalize_service(svc: &mut String) {
2626
truncate_utf8(svc, MAX_SERVICE_LEN);
2727
normalize_tag(svc);
2828
if svc.is_empty() {
29-
*svc = DEFAULT_SERVICE_NAME.to_owned();
29+
DEFAULT_SERVICE_NAME.clone_into(svc);
3030
}
3131
}
3232

@@ -35,13 +35,14 @@ pub fn normalize_name(name: &mut String) {
3535
truncate_utf8(name, MAX_NAME_LEN);
3636
normalize_metric_name(name);
3737
if name.is_empty() {
38-
*name = DEFAULT_SPAN_NAME.to_owned();
38+
DEFAULT_SPAN_NAME.clone_into(name);
3939
}
4040
}
4141

42+
#[allow(clippy::ptr_arg)]
4243
pub fn normalize_resource(resource: &mut String, name: &str) {
4344
if resource.is_empty() {
44-
*resource = name.to_owned();
45+
name.clone_into(resource);
4546
}
4647
}
4748

@@ -55,7 +56,7 @@ pub fn normalize_span_start_duration(start: &mut i64, duration: &mut i64) {
5556
if *duration < 0 {
5657
*duration = 0;
5758
}
58-
if *duration > std::i64::MAX - *start {
59+
if *duration > i64::MAX - *start {
5960
*duration = 0;
6061
}
6162

0 commit comments

Comments
 (0)