Skip to content

Commit 9c83e3f

Browse files
authored
address clippy warnings for azure_iot_deviceupdate (#1405)
1 parent 3589920 commit 9c83e3f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

sdk/iot_deviceupdate/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl DeviceUpdateClient {
110110
if resp.status() == 202u16 {
111111
let headers = resp.headers();
112112
return match headers.get("operation-location") {
113-
Some(location) => location.to_str().map(|x| x.to_string()).context(
113+
Some(location) => location.to_str().map(ToString::to_string).context(
114114
ErrorKind::Other,
115115
"invalid characters in operation-location path",
116116
),

sdk/iot_deviceupdate/src/device_update.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,7 @@ impl DeviceUpdateClient {
202202
}))
203203
}
204204
OperationStatus::Succeeded => return Ok(update_operation),
205-
OperationStatus::NotStarted => continue,
206-
OperationStatus::Running => continue,
205+
OperationStatus::NotStarted | OperationStatus::Running => continue,
207206
OperationStatus::Undefined => {
208207
return Err(Error::with_message(ErrorKind::Other, || {
209208
format!(

sdk/iot_deviceupdate/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod tests {
1717
pub(crate) fn mock_client(server_url: String) -> crate::client::DeviceUpdateClient {
1818
crate::client::DeviceUpdateClient {
1919
device_update_url: url::Url::parse(&server_url).unwrap(),
20-
endpoint: "".to_string(),
20+
endpoint: String::new(),
2121
token_credential: AutoRefreshingTokenCredential::new(Arc::new(MockCredential)),
2222
}
2323
}

0 commit comments

Comments
 (0)