Skip to content

Commit f349b89

Browse files
committed
Fix clippy warnings
Signed-off-by: Didier Wenzek <didier.wenzek@free.fr>
1 parent 7c0b549 commit f349b89

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

crates/common/tedge_config_macros/src/multi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ mod tests {
416416
});
417417
let dto: TEdgeConfigDto = serde_json::from_value(val.clone()).unwrap();
418418

419-
assert_eq!(serde_json::to_value(&dto).unwrap(), val);
419+
assert_eq!(serde_json::to_value(dto).unwrap(), val);
420420
}
421421

422422
#[test]
@@ -431,7 +431,7 @@ mod tests {
431431
});
432432
let dto: TEdgeConfigDto = serde_json::from_value(val.clone()).unwrap();
433433

434-
assert_eq!(serde_json::to_value(&dto).unwrap(), val);
434+
assert_eq!(serde_json::to_value(dto).unwrap(), val);
435435
}
436436

437437
#[test]

crates/core/tedge/src/cli/connect/command.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ fn check_device_status_azure(
718718
if tedge_config.mqtt.bridge.built_in {
719719
client.subscribe(&built_in_bridge_health, AtLeastOnce)?;
720720
}
721-
client.subscribe(&azure_topic_device_twin_downstream, AtLeastOnce)?;
721+
client.subscribe(azure_topic_device_twin_downstream, AtLeastOnce)?;
722722

723723
let mut err = None;
724724
for event in connection.iter() {

crates/core/tedge/src/cli/connect/jwt_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub(crate) fn get_connected_c8y_url(
3333
let mut acknowledged = false;
3434
let mut c8y_url: Option<String> = None;
3535

36-
client.subscribe(&c8y_topic_builtin_jwt_token_downstream, AtLeastOnce)?;
36+
client.subscribe(c8y_topic_builtin_jwt_token_downstream, AtLeastOnce)?;
3737
let mut err = None;
3838

3939
for event in connection.iter() {

crates/core/tedge_agent/src/operation_workflows/persist.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,13 @@ impl WorkflowRepository {
102102
for entry in dir_path.read_dir_utf8()?.flatten() {
103103
let file = entry.path();
104104
if file.extension() == Some("toml") {
105-
match read_operation_workflow(file)
105+
let result = read_operation_workflow(file)
106106
.await
107107
.and_then(|(workflow, version)| {
108108
let file_source = source.set_inner(file.into());
109109
self.load_operation_workflow(file_source, workflow, version)
110-
}) {
110+
});
111+
match result {
111112
Ok(cmd) => {
112113
info!(
113114
"Using operation workflow definition from {file:?} for '{cmd}' operation"

crates/core/tedge_api/src/workflow/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ impl GenericCommandState {
196196
o.insert(key.into(), val.into());
197197
}
198198
if key == STATUS {
199-
self.status = val.to_owned();
199+
val.clone_into(&mut self.status)
200200
}
201201
}
202202

plugins/c8y_remote_access_plugin/src/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl RemoteAccessConnect {
130130
stdin.read_line(&mut command).unwrap();
131131

132132
// If it's a smartrest message, it contains a ','
133-
if !command.contains(",") {
133+
if !command.contains(',') {
134134
c8y_profile = Some(command.trim().parse().expect("Parsing profile name"));
135135
command.clear();
136136
stdin.read_line(&mut command).unwrap();

0 commit comments

Comments
 (0)