Skip to content

Commit 0cede91

Browse files
authored
Deny clippy::large_futures and fix +nightly lint (Azure#1895)
* Deny clippy::large_futures and fix +nightly lint * Fix test errors * Add clippy to cspell dictionary
1 parent 2b536c6 commit 0cede91

File tree

16 files changed

+36
-47
lines changed

16 files changed

+36
-47
lines changed

.vscode/cspell.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"asyncoperation",
2525
"azsdk",
2626
"azurecli",
27-
"Contoso",
27+
"clippy",
28+
"contoso",
2829
"cplusplus",
2930
"datalake",
3031
"datetime",
@@ -40,7 +41,7 @@
4041
"iothub",
4142
"keyvault",
4243
"msrc",
43-
"Newtonsoft",
44+
"newtonsoft",
4445
"oidc",
4546
"pageable",
4647
"pkce",

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,5 @@ tz-rs = { version = "0.6" }
105105
url = "2.2"
106106
uuid = { version = "1.0", features = ["v4"] }
107107

108-
[workspace.lints]
108+
[workspace.lints.clippy]
109+
large_futures = "deny"

eng/test/mock_transport/src/mock_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<'de> Visitor<'de> for RequestVisitor {
116116
}
117117
}
118118

119-
impl<'a> Serialize for RequestSerializer<'a> {
119+
impl Serialize for RequestSerializer<'_> {
120120
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
121121
where
122122
S: Serializer,

sdk/core/azure_core/src/hmac.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use crate::{
99
};
1010

1111
/// Tries to create an HMAC SHA256 signature from the given `data` and `key`.
12+
///
1213
/// The `key` is expected to be a base64 encoded string and will be decoded
1314
/// before using it for signing. The returned signature is also base64 encoded.
1415
///

sdk/core/azure_core_amqp/src/fe2o3/cbs.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ impl<'a> Fe2o3ClaimsBasedSecurity<'a> {
2727
}
2828
}
2929

30-
impl<'a> Fe2o3ClaimsBasedSecurity<'a> {}
30+
impl Fe2o3ClaimsBasedSecurity<'_> {}
3131

32-
impl<'a> Drop for Fe2o3ClaimsBasedSecurity<'a> {
32+
impl Drop for Fe2o3ClaimsBasedSecurity<'_> {
3333
fn drop(&mut self) {
3434
debug!("Dropping Fe2o3ClaimsBasedSecurity.");
3535
}
3636
}
3737

38-
impl<'a> AmqpClaimsBasedSecurityApis for Fe2o3ClaimsBasedSecurity<'a> {
38+
impl AmqpClaimsBasedSecurityApis for Fe2o3ClaimsBasedSecurity<'_> {
3939
async fn attach(&self) -> Result<()> {
4040
let session = self.session.implementation.get()?;
4141
let mut session = session.lock().await;

sdk/core/azure_core_amqp/src/fe2o3/management.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'a> WithApplicationPropertiesRequest<'a> {
134134
}
135135
}
136136

137-
impl<'a> fe2o3_amqp_management::Request for WithApplicationPropertiesRequest<'a> {
137+
impl fe2o3_amqp_management::Request for WithApplicationPropertiesRequest<'_> {
138138
const OPERATION: &'static str = "READ";
139139
type Response = ReadResponse;
140140
type Body = ();

sdk/core/azure_core_amqp/src/messaging.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,8 @@ impl AmqpApplicationProperties {
10541054
}
10551055
}
10561056

1057-
/// An AMQP message
1057+
/// An AMQP message.
1058+
///
10581059
/// This is a simplified version of the AMQP message
10591060
/// that is used in the Azure SDK for Event Hubs
10601061
/// and is not a complete implementation of the AMQP message

sdk/cosmos/azure_data_cosmos/examples/cosmos/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ pub async fn main() -> Result<(), Box<dyn Error>> {
5454
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
5555
.init();
5656

57-
let mut args = ProgramArgs::parse();
57+
let args = ProgramArgs::parse();
5858

5959
let Some(cmd) = args.subcommand else {
6060
ProgramArgs::command().print_long_help()?;
6161
return Ok(());
6262
};
6363

64-
let client = create_client(&mut args.shared_args)?;
64+
let client = create_client(&args.shared_args)?;
6565

6666
match cmd {
6767
Subcommands::Create(cmd) => cmd.run(client).await,

sdk/eventhubs/azure_messaging_eventhubs/src/lib.rs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,6 @@
66
// cspell: words amqp eventdata
77
#![doc = include_str!("../README.md")]
88

9-
/// This module contains the implementation of the Azure Messaging Event Hubs SDK for Rust.
10-
///
11-
/// The SDK provides types and functions to interact with Azure Event Hubs, which is a highly scalable data streaming platform and event ingestion service.
12-
/// It allows you to consume events from an Event Hub and create/send events to an Event Hub.
13-
///
14-
/// # Examples
15-
///
16-
/// Consuming events from an Event Hub:
17-
///
18-
/// ```no_run
19-
/// # use azure_identity::{DefaultAzureCredential, TokenCredentialOptions};
20-
/// # #[tokio::main]
21-
/// # async fn main() -> Result<(), Box<dyn std::error::Error + 'static>> {
22-
/// # let my_credentials = DefaultAzureCredential::new()?;
23-
24-
/// use azure_messaging_eventhubs::consumer::ConsumerClient;
25-
/// use azure_messaging_eventhubs::models::EventData;
26-
///
27-
/// let consumer_client = ConsumerClient::new("fully_qualified_domain", "eventhub_name", None, my_credentials, None);
28-
/// let partition_properties = consumer_client.get_partition_properties("0").await?;
29-
/// # Ok(())
30-
/// }
31-
/// ```
32-
///
339
pub(crate) mod common;
3410

3511
/// Types related to consuming events from an Event Hub.
@@ -408,8 +384,8 @@ pub mod models {
408384
}
409385

410386
/// Represents the data associated with an event received from an Event Hub.
411-
/// This struct provides the event data, enqueued time, offset, sequence number, partition key, and system properties of the event.
412387
///
388+
/// This struct provides the event data, enqueued time, offset, sequence number, partition key, and system properties of the event.
413389
pub struct ReceivedEventData {
414390
message: AmqpMessage,
415391
event_data: EventData,

sdk/typespec/typespec_client_core/examples/binary_data_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use typespec_client_core::{fs::FileStreamBuilder, http::RequestContent};
99
#[tokio::main]
1010
async fn main() -> Result<(), Box<dyn std::error::Error>> {
1111
// Log traces to stdout.
12-
let _log = tracing_subscriber::fmt()
12+
tracing_subscriber::fmt()
1313
.with_span_events(FmtSpan::ENTER | FmtSpan::EXIT)
1414
.with_max_level(LevelFilter::DEBUG)
1515
.init();

0 commit comments

Comments
 (0)