Skip to content

Commit

Permalink
ref(core): Use clone_from instead of clone as suggested by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias Ram committed May 24, 2024
1 parent 801d7ca commit f15f559
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions sentry-core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@ impl Client {
}

if event.release.is_none() {
event.release = self.options.release.clone();
event.release.clone_from(&self.options.release);
}
if event.environment.is_none() {
event.environment = self.options.environment.clone();
event.environment.clone_from(&self.options.environment);
}
if event.server_name.is_none() {
event.server_name = self.options.server_name.clone();
event.server_name.clone_from(&self.options.server_name);
}
if &event.platform == "other" {
event.platform = "native".into();
Expand Down
2 changes: 1 addition & 1 deletion sentry-core/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ impl Metric {
"{}@{}:{}|{}|#{}|T{}",
NormalizedName::from(self.name.as_ref()),
NormalizedUnit::from(self.unit),
self.value,
"1:2",
self.value.ty(),
NormalizedTags::from(self.tags),
timestamp
Expand Down
4 changes: 2 additions & 2 deletions sentry-core/src/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ impl Transaction {

Hub::current().with_current_scope(|scope| scope.apply_to_transaction(&mut transaction));
let opts = client.options();
transaction.release = opts.release.clone();
transaction.environment = opts.environment.clone();
transaction.release.clone_from(&opts.release);
transaction.environment.clone_from(&opts.environment);
transaction.sdk = Some(std::borrow::Cow::Owned(client.sdk_info.clone()));

drop(inner);
Expand Down

0 comments on commit f15f559

Please sign in to comment.