Skip to content

Commit

Permalink
chore(config): reduce useless clone
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonbrad committed Mar 30, 2024
1 parent 4a814b1 commit 6a8f748
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ impl Config {
}
Data::Simple(value) => {
let filepath = config_path
.join(value.clone())
.join(value.to_owned())
.to_str()
.unwrap()
.to_string();
Expand All @@ -325,7 +325,7 @@ impl Config {
translation.extend(conf.translation.unwrap_or_default());
}
Data::Simple(_) | Data::Multi(_) => {
translation.insert(key.to_owned(), value.clone());
translation.insert(key.to_owned(), value.to_owned());
}
Data::Detailed(DetailedData { value, alias }) => {
alias.iter().chain([key.to_owned()].iter()).for_each(|e| {
Expand All @@ -334,7 +334,7 @@ impl Config {
}
Data::MoreDetailed(MoreDetailedData { values, alias }) => {
alias.iter().chain([key.to_owned()].iter()).for_each(|key| {
translation.insert(key.to_owned(), Data::Multi(values.clone()));
translation.insert(key.to_owned(), Data::Multi(values.to_owned()));
});
}
};
Expand Down

0 comments on commit 6a8f748

Please sign in to comment.