Skip to content

Commit bc8ba72

Browse files
authored
address clippy warnings for azure_data_cosmos (#1399)
1 parent 7af9ed7 commit bc8ba72

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

sdk/data_cosmos/src/authorization_policy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ fn generate_resource_link(request: &Request) -> String {
132132
.map(|ending| &ending[1..]) // this is safe since every ENDING_STRING starts with a slash
133133
.any(|item| uri == item)
134134
{
135-
"".to_string()
135+
String::new()
136136
} else {
137137
uri.to_string()
138138
}

sdk/data_cosmos/src/clients/cosmos.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,12 @@ impl CloudLocation {
231231

232232
fn auth_token(&self) -> AuthorizationToken {
233233
match self {
234-
CloudLocation::Public { auth_token, .. } => auth_token.clone(),
235-
CloudLocation::China { auth_token, .. } => auth_token.clone(),
234+
CloudLocation::Public { auth_token, .. }
235+
| CloudLocation::China { auth_token, .. }
236+
| CloudLocation::Custom { auth_token, .. } => auth_token.clone(),
236237
CloudLocation::Emulator { .. } => {
237238
AuthorizationToken::primary_from_base64(EMULATOR_ACCOUNT_KEY).unwrap()
238239
}
239-
CloudLocation::Custom { auth_token, .. } => auth_token.clone(),
240240
}
241241
}
242242
}

sdk/data_cosmos/src/operations/create_or_replace_user_defined_function.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ operation! {
1818
impl CreateOrReplaceUserDefinedFunctionBuilder {
1919
pub fn into_future(self) -> CreateOrReplaceUserDefinedFunction {
2020
Box::pin(async move {
21-
let mut request = match self.is_create {
22-
true => self.client.udfs_request(azure_core::Method::Post),
23-
false => self.client.udf_request(azure_core::Method::Put),
21+
let mut request = if self.is_create {
22+
self.client.udfs_request(azure_core::Method::Post)
23+
} else {
24+
self.client.udf_request(azure_core::Method::Put)
2425
};
2526

2627
if let Some(cl) = &self.consistency_level {

sdk/data_cosmos/src/resources/permission/permission.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ impl PermissionMode {
8181
/// The full addressable path of the resource associated with the permission
8282
pub fn resource(&self) -> &str {
8383
match self {
84-
Self::All(s) => s.as_ref(),
85-
Self::Read(s) => s.as_ref(),
84+
Self::All(s) | Self::Read(s) => s.as_ref(),
8685
}
8786
}
8887
}

sdk/data_cosmos/src/resources/permission/permission_token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct PermissionToken {
1717

1818
impl PartialEq for PermissionToken {
1919
fn eq(&self, other: &Self) -> bool {
20-
use AuthorizationToken::*;
20+
use AuthorizationToken::{Primary, Resource};
2121
match (&self.token, &other.token) {
2222
(Primary(a), Primary(b)) => a == b,
2323
(Resource(a), Resource(b)) => a == b,

0 commit comments

Comments
 (0)