Skip to content

Commit

Permalink
address clippy warnings for azure_data_cosmos (#1399)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoray authored Sep 20, 2023
1 parent 7af9ed7 commit bc8ba72
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sdk/data_cosmos/src/authorization_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ fn generate_resource_link(request: &Request) -> String {
.map(|ending| &ending[1..]) // this is safe since every ENDING_STRING starts with a slash
.any(|item| uri == item)
{
"".to_string()
String::new()
} else {
uri.to_string()
}
Expand Down
6 changes: 3 additions & 3 deletions sdk/data_cosmos/src/clients/cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,12 @@ impl CloudLocation {

fn auth_token(&self) -> AuthorizationToken {
match self {
CloudLocation::Public { auth_token, .. } => auth_token.clone(),
CloudLocation::China { auth_token, .. } => auth_token.clone(),
CloudLocation::Public { auth_token, .. }
| CloudLocation::China { auth_token, .. }
| CloudLocation::Custom { auth_token, .. } => auth_token.clone(),
CloudLocation::Emulator { .. } => {
AuthorizationToken::primary_from_base64(EMULATOR_ACCOUNT_KEY).unwrap()
}
CloudLocation::Custom { auth_token, .. } => auth_token.clone(),
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ operation! {
impl CreateOrReplaceUserDefinedFunctionBuilder {
pub fn into_future(self) -> CreateOrReplaceUserDefinedFunction {
Box::pin(async move {
let mut request = match self.is_create {
true => self.client.udfs_request(azure_core::Method::Post),
false => self.client.udf_request(azure_core::Method::Put),
let mut request = if self.is_create {
self.client.udfs_request(azure_core::Method::Post)
} else {
self.client.udf_request(azure_core::Method::Put)
};

if let Some(cl) = &self.consistency_level {
Expand Down
3 changes: 1 addition & 2 deletions sdk/data_cosmos/src/resources/permission/permission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ impl PermissionMode {
/// The full addressable path of the resource associated with the permission
pub fn resource(&self) -> &str {
match self {
Self::All(s) => s.as_ref(),
Self::Read(s) => s.as_ref(),
Self::All(s) | Self::Read(s) => s.as_ref(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct PermissionToken {

impl PartialEq for PermissionToken {
fn eq(&self, other: &Self) -> bool {
use AuthorizationToken::*;
use AuthorizationToken::{Primary, Resource};
match (&self.token, &other.token) {
(Primary(a), Primary(b)) => a == b,
(Resource(a), Resource(b)) => a == b,
Expand Down

0 comments on commit bc8ba72

Please sign in to comment.