Skip to content

Commit

Permalink
fixup! fixup! Avoid returning String when callers expect &str
Browse files Browse the repository at this point in the history
  • Loading branch information
didier-wenzek committed Dec 19, 2024
1 parent 4d75b3d commit eecd222
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/core/tedge_agent/src/operation_workflows/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl WorkflowRepository {
if let Err(err) = tokio::fs::copy(source.clone(), target.clone()).await {
error!("Fail to persist a copy of {source} as {target}: {err}");
} else {
self.in_use_copies.insert(version.to_string(), 1);
self.in_use_copies.insert(version.to_owned(), 1);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/core/tedge_api/src/workflow/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ impl GenericCommandState {

fn set_key_value(&mut self, key: &str, val: &str) {
if let Some(o) = self.payload.as_object_mut() {
o.insert(key.to_string(), val.into());
o.insert(key.into(), val.into());
}
if key == STATUS {
self.status = val.to_string();
self.status = val.to_owned();
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/core/tedge_api/src/workflow/supervisor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl WorkflowSupervisor {
/// Return the current version if any.
pub fn use_current_version(&mut self, operation: &OperationName) -> Option<WorkflowVersion> {
self.workflows
.get_mut(&operation.as_str().into())
.map(WorkflowVersions::use_current_version)?
.get_mut(&operation.as_str().into())?
.use_current_version()
.cloned()
}

Expand Down

0 comments on commit eecd222

Please sign in to comment.