Skip to content

Commit

Permalink
fix clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Akhil T Thomas <[email protected]>
  • Loading branch information
deliteser112 committed Jan 26, 2024
1 parent 74d67a1 commit 5bb97c5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 7 deletions.
8 changes: 3 additions & 5 deletions kuksa_databroker/databroker-cli/src/kuksa_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub async fn kuksa_main(_cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
entry
.metadata
.and_then(|meta| meta.unit)
.map(|unit| format!("{}", unit))
.map(|unit| unit.to_string())
.unwrap_or_else(|| "".to_string())
);
} else {
Expand Down Expand Up @@ -532,10 +532,8 @@ pub async fn kuksa_main(_cli: Cli) -> Result<(), Box<dyn std::error::Error>> {
.and_then(
|meta| meta.unit
)
.map(|unit| format!(
"{}",
unit
))
.map(|unit| unit
.to_string())
.unwrap_or_else(
|| "".to_string()
)
Expand Down
25 changes: 25 additions & 0 deletions kuksa_databroker/databroker/src/broker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ pub struct AuthorizedAccess<'a, 'b> {
}

impl<'a, 'b> AuthorizedAccess<'a, 'b> {
#[allow(clippy::too_many_arguments)]
pub async fn add_entry(
&self,
name: String,
Expand Down Expand Up @@ -1647,6 +1648,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -1677,6 +1679,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand All @@ -1697,6 +1700,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -1767,6 +1771,7 @@ mod tests {
data_type: None,
description: None,
allowed: Some(Some(DataValue::Int32Array(vec![100]))),
unit: None,
},
)])
.await
Expand All @@ -1788,6 +1793,7 @@ mod tests {
data_type: None,
description: None,
allowed: Some(Some(DataValue::BoolArray(vec![true]))),
unit: None,
},
)])
.await
Expand All @@ -1809,6 +1815,7 @@ mod tests {
data_type: None,
description: None,
allowed: Some(None),
unit: None,
},
)])
.await
Expand All @@ -1830,6 +1837,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -1899,6 +1907,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -1999,6 +2008,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2080,6 +2090,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2137,6 +2148,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2233,6 +2245,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
),
(
Expand All @@ -2248,6 +2261,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
),
])
Expand Down Expand Up @@ -2309,6 +2323,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2377,6 +2392,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2455,6 +2471,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2510,6 +2527,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2563,6 +2581,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2607,6 +2626,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2634,6 +2654,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2689,6 +2710,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2716,6 +2738,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2774,6 +2797,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down Expand Up @@ -2859,6 +2883,7 @@ mod tests {
data_type: None,
description: None,
allowed: None,
unit: None,
},
)])
.await
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,10 @@ impl From<broker::EntryUpdate> for proto::DataEntry {
None => None,
},
metadata: {
let mut metadata = proto::Metadata::default();
metadata.unit = from.unit;
let metadata = proto::Metadata {
unit: from.unit,
..Default::default()
};
Some(metadata)
},
}
Expand Down

0 comments on commit 5bb97c5

Please sign in to comment.