From cb780f3f6c59f373d347862d39c826b9e74d972a Mon Sep 17 00:00:00 2001 From: Edward Rudd Date: Mon, 4 Jul 2022 18:54:07 -0400 Subject: [PATCH] Fix nightly rustfmt (#970) * fix format of other code due to new nightly * Adjust github fmt checks to use a fixed nightly version --- .github/workflows/ci.yml | 12 ++++++------ integrations/actix-web/tests/graphql.rs | 12 +++++------- src/extensions/opentelemetry.rs | 7 +++---- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcc4dba4..1a39e0cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: fail-fast: false matrix: include: - - { rust: stable, os: ubuntu-latest } + - { rust: nightly-2022-06-29, os: ubuntu-latest } steps: - name: Checkout uses: actions/checkout@v2 @@ -78,11 +78,11 @@ jobs: submodules: true - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: ${{ matrix.rust }} override: true components: rustfmt - name: Check format - run: cargo +nightly fmt --all -- --check + run: cargo +${{ matrix.rust }} fmt --all -- --check clippy: name: Run clippy - Rust (${{ matrix.rust }}) on ${{ matrix.os }} @@ -135,7 +135,7 @@ jobs: fail-fast: false matrix: include: - - { rust: stable, os: ubuntu-latest } + - { rust: nightly-2022-06-29, os: ubuntu-latest } steps: - name: Checkout uses: actions/checkout@v2 @@ -144,11 +144,11 @@ jobs: - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: ${{ matrix.rust }} override: true components: clippy, rustfmt - name: Check examples format - run: cargo +nightly fmt --all -- --check + run: cargo +${{ matrix.rust }} fmt --all -- --check working-directory: ./examples - uses: actions-rs/toolchain@v1 diff --git a/integrations/actix-web/tests/graphql.rs b/integrations/actix-web/tests/graphql.rs index a86c2aad..02ce42ae 100644 --- a/integrations/actix-web/tests/graphql.rs +++ b/integrations/actix-web/tests/graphql.rs @@ -137,13 +137,11 @@ async fn test_hello_header() { async fn test_count() { let srv = test::init_service( App::new() - .app_data( - Data::new( - Schema::build(CountQueryRoot, CountMutation, EmptySubscription) - .data(Count::default()) - .finish(), - ), - ) + .app_data(Data::new( + Schema::build(CountQueryRoot, CountMutation, EmptySubscription) + .data(Count::default()) + .finish(), + )) .service( web::resource("/") .guard(guard::Post()) diff --git a/src/extensions/opentelemetry.rs b/src/extensions/opentelemetry.rs index f1755d43..f0f5aa67 100644 --- a/src/extensions/opentelemetry.rs +++ b/src/extensions/opentelemetry.rs @@ -83,14 +83,13 @@ where next: NextSubscribe<'_>, ) -> BoxStream<'s, Response> { Box::pin( - next.run(ctx, stream).with_context( - OpenTelemetryContext::current_with_span( + next.run(ctx, stream) + .with_context(OpenTelemetryContext::current_with_span( self.tracer .span_builder("subscribe") .with_kind(SpanKind::Server) .start(&*self.tracer), - ), - ), + )), ) }