From 673d5c647cad1d17bb0b781f5822af8cae7f0995 Mon Sep 17 00:00:00 2001 From: Heath Stewart Date: Wed, 6 Nov 2024 13:54:21 -0800 Subject: [PATCH] Fixed a few more nightly lints (#1901) Made sure we're actually checking everything as well. --- eng/scripts/Analyze-Code.ps1 | 4 ++-- eng/scripts/Test-Packages.ps1 | 16 +++++++++++++++- .../src/clients/cosmos_client.rs | 2 +- .../examples/binary_data_request.rs | 1 - .../typespec_client_core/src/error/http_error.rs | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/eng/scripts/Analyze-Code.ps1 b/eng/scripts/Analyze-Code.ps1 index 7e0af21150..4d0a129cd3 100644 --- a/eng/scripts/Analyze-Code.ps1 +++ b/eng/scripts/Analyze-Code.ps1 @@ -18,11 +18,11 @@ Write-Host "Analyzing code with $env:RUSTDOCFLAGS = "-D warnings" $env:RUSTFLAGS = "-Dwarnings" -Invoke-LoggedCommand "cargo +$Toolchain check -p azure_core --no-default-features --keep-going" +Invoke-LoggedCommand "cargo +$Toolchain check -p azure_core --all-features --all-targets --keep-going" Invoke-LoggedCommand "cargo +$Toolchain fmt --all -- --check" -Invoke-LoggedCommand "cargo +$Toolchain clippy --workspace --keep-going --no-deps" +Invoke-LoggedCommand "cargo +$Toolchain clippy --workspace --all-features --all-targets --keep-going --no-deps" Invoke-LoggedCommand "cargo +$Toolchain doc --workspace --no-deps" diff --git a/eng/scripts/Test-Packages.ps1 b/eng/scripts/Test-Packages.ps1 index 491c7533a8..5f5c8a49b8 100644 --- a/eng/scripts/Test-Packages.ps1 +++ b/eng/scripts/Test-Packages.ps1 @@ -49,9 +49,23 @@ foreach ($package in $packagesToTest) { Invoke-LoggedCommand "cargo +$Toolchain build --keep-going" Write-Host "`n`n" - Invoke-LoggedCommand "cargo +$Toolchain test --lib --no-fail-fast" + + $targets = @() + if ($UnitTests) { + $targets += "--lib" + } + + if ($FunctionalTests) { + $targets += "--bins" + $targets += "--examples" + $targets += "--benches" + } + + Invoke-LoggedCommand "cargo +$Toolchain test $($targets -join ' ') --no-fail-fast" Write-Host "`n`n" + Invoke-LoggedCommand "cargo +$Toolchain test --doc --no-fail-fast" + Write-Host "`n`n" } finally { Pop-Location diff --git a/sdk/cosmos/azure_data_cosmos/src/clients/cosmos_client.rs b/sdk/cosmos/azure_data_cosmos/src/clients/cosmos_client.rs index 9b6c64f36f..a2a0885a57 100644 --- a/sdk/cosmos/azure_data_cosmos/src/clients/cosmos_client.rs +++ b/sdk/cosmos/azure_data_cosmos/src/clients/cosmos_client.rs @@ -82,7 +82,7 @@ impl CosmosClient { databases_link: ResourceLink::root(ResourceType::Databases), pipeline: CosmosPipeline::new( endpoint.parse()?, - AuthorizationPolicy::from_shared_key(key.into()), + AuthorizationPolicy::from_shared_key(key), options.client_options, ), }) diff --git a/sdk/typespec/typespec_client_core/examples/binary_data_request.rs b/sdk/typespec/typespec_client_core/examples/binary_data_request.rs index 2bc7669ae9..d8dedc09d2 100644 --- a/sdk/typespec/typespec_client_core/examples/binary_data_request.rs +++ b/sdk/typespec/typespec_client_core/examples/binary_data_request.rs @@ -45,7 +45,6 @@ mod client { pub async fn put_binary_data( body: RequestContent<()>, ) -> typespec_client_core::Result> { - let body: RequestContent<()> = body.into(); let body: Body = body.into(); let content = match body { diff --git a/sdk/typespec/typespec_client_core/src/error/http_error.rs b/sdk/typespec/typespec_client_core/src/error/http_error.rs index 8860b8382f..d968192f00 100644 --- a/sdk/typespec/typespec_client_core/src/error/http_error.rs +++ b/sdk/typespec/typespec_client_core/src/error/http_error.rs @@ -104,7 +104,7 @@ impl fmt::Debug for HttpError { impl fmt::Display for HttpError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { struct Unquote<'a>(&'a str); - impl<'a> fmt::Debug for Unquote<'a> { + impl fmt::Debug for Unquote<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_str(self.0) }