Skip to content

Commit 2ac449c

Browse files
bmc-msftdemoray
andauthored
address reasonable clippy lints from nightly (#841)
* address reasonable clippy lints from nightly * fmt Co-authored-by: Brian Caswell <[email protected]>
1 parent 4d6f02a commit 2ac449c

File tree

7 files changed

+10
-22
lines changed

7 files changed

+10
-22
lines changed

sdk/core/src/request_options/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl Metadata {
4848
self.0.iter().map(|(key, value)| {
4949
Metadatum(
5050
key.clone(),
51-
std::str::from_utf8(&*value)
51+
std::str::from_utf8(value)
5252
.expect("non-utf8 header value")
5353
.into(),
5454
)

sdk/data_cosmos/src/headers/from_headers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ pub(crate) fn schema_version_from_headers(headers: &Headers) -> azure_core::Resu
144144
}
145145

146146
pub(crate) fn server_from_headers(headers: &Headers) -> azure_core::Result<&str> {
147-
headers::get_str_from_headers(headers, &http::header::SERVER.to_string())
147+
headers::get_str_from_headers(headers, http::header::SERVER.as_ref())
148148
}
149149

150150
pub(crate) fn service_version_from_headers(headers: &Headers) -> azure_core::Result<&str> {
151151
headers::get_str_from_headers(headers, HEADER_SERVICE_VERSION)
152152
}
153153

154154
pub(crate) fn content_location_from_headers(headers: &Headers) -> azure_core::Result<&str> {
155-
headers::get_str_from_headers(headers, &http::header::CONTENT_LOCATION.to_string())
155+
headers::get_str_from_headers(headers, http::header::CONTENT_LOCATION.as_ref())
156156
}
157157

158158
pub(crate) fn gateway_version_from_headers(headers: &Headers) -> azure_core::Result<&str> {

sdk/messaging_servicebus/src/service_bus/mod.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,7 @@ async fn peek_lock_message(
147147
) -> azure_core::Result<CollectedResponse> {
148148
let url = craft_peek_lock_url(namespace, queue, lock_expiry)?;
149149

150-
let req = prepare_request(
151-
&url.to_string(),
152-
Method::POST,
153-
None,
154-
policy_name,
155-
signing_key,
156-
)?;
150+
let req = prepare_request(url.as_ref(), Method::POST, None, policy_name, signing_key)?;
157151

158152
http_client
159153
.as_ref()
@@ -175,13 +169,7 @@ async fn peek_lock_message2(
175169
) -> azure_core::Result<PeekLockResponse> {
176170
let url = craft_peek_lock_url(namespace, queue, lock_expiry)?;
177171

178-
let req = prepare_request(
179-
&url.to_string(),
180-
Method::POST,
181-
None,
182-
policy_name,
183-
signing_key,
184-
)?;
172+
let req = prepare_request(url.as_ref(), Method::POST, None, policy_name, signing_key)?;
185173

186174
let res = http_client.execute_request(&req).await?;
187175

sdk/security_keyvault/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod tests {
1414
#[macro_export]
1515
macro_rules! mock_key_client {
1616
($keyvault_name:expr, $creds:expr, ) => {{
17-
crate::client::KeyClient {
17+
$crate::client::KeyClient {
1818
vault_url: url::Url::parse(&mockito::server_url()).unwrap(),
1919
endpoint: "".to_string(),
2020
token_credential: $creds,
@@ -25,7 +25,7 @@ mod tests {
2525
#[macro_export]
2626
macro_rules! mock_cert_client {
2727
($keyvault_name:expr, $creds:expr, ) => {{
28-
crate::client::CertificateClient {
28+
$crate::client::CertificateClient {
2929
vault_url: url::Url::parse(&mockito::server_url()).unwrap(),
3030
endpoint: "".to_string(),
3131
token_credential: $creds,

sdk/storage/src/core/clients/storage_account_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ fn canonicalized_resource(account: &str, u: &url::Url) -> String {
634634

635635
for p in paths {
636636
can_res.push('/');
637-
can_res.push_str(&*p);
637+
can_res.push_str(p);
638638
}
639639
can_res += "\n";
640640

sdk/storage_datalake/src/authorization_policies/shared_key.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fn canonicalized_resource(account: &str, u: &url::Url) -> String {
161161

162162
for p in paths {
163163
can_res.push('/');
164-
can_res.push_str(&*p);
164+
can_res.push_str(p);
165165
}
166166
can_res += "\n";
167167

sdk/storage_datalake/src/file_system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ mod tests {
100100
#[test]
101101
fn test_path_serialization() {
102102
let payload = json!({
103-
"contentLength": 100 as i64,
103+
"contentLength": 100_i64,
104104
"etag": "etag",
105105
"group": "group",
106106
"isDirectory": true,

0 commit comments

Comments
 (0)