Fix nightly rustfmt (#970)

* fix format of other code due to new nightly

* Adjust github fmt checks to use a fixed nightly version
This commit is contained in:
Edward Rudd 2022-07-04 18:54:07 -04:00 committed by GitHub
parent a19298beaf
commit cb780f3f6c
3 changed files with 14 additions and 17 deletions

View File

@ -70,7 +70,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { rust: stable, os: ubuntu-latest } - { rust: nightly-2022-06-29, os: ubuntu-latest }
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -78,11 +78,11 @@ jobs:
submodules: true submodules: true
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly toolchain: ${{ matrix.rust }}
override: true override: true
components: rustfmt components: rustfmt
- name: Check format - name: Check format
run: cargo +nightly fmt --all -- --check run: cargo +${{ matrix.rust }} fmt --all -- --check
clippy: clippy:
name: Run clippy - Rust (${{ matrix.rust }}) on ${{ matrix.os }} name: Run clippy - Rust (${{ matrix.rust }}) on ${{ matrix.os }}
@ -135,7 +135,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- { rust: stable, os: ubuntu-latest } - { rust: nightly-2022-06-29, os: ubuntu-latest }
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
@ -144,11 +144,11 @@ jobs:
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
toolchain: nightly toolchain: ${{ matrix.rust }}
override: true override: true
components: clippy, rustfmt components: clippy, rustfmt
- name: Check examples format - name: Check examples format
run: cargo +nightly fmt --all -- --check run: cargo +${{ matrix.rust }} fmt --all -- --check
working-directory: ./examples working-directory: ./examples
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1

View File

@ -137,13 +137,11 @@ async fn test_hello_header() {
async fn test_count() { async fn test_count() {
let srv = test::init_service( let srv = test::init_service(
App::new() App::new()
.app_data( .app_data(Data::new(
Data::new( Schema::build(CountQueryRoot, CountMutation, EmptySubscription)
Schema::build(CountQueryRoot, CountMutation, EmptySubscription) .data(Count::default())
.data(Count::default()) .finish(),
.finish(), ))
),
)
.service( .service(
web::resource("/") web::resource("/")
.guard(guard::Post()) .guard(guard::Post())

View File

@ -83,14 +83,13 @@ where
next: NextSubscribe<'_>, next: NextSubscribe<'_>,
) -> BoxStream<'s, Response> { ) -> BoxStream<'s, Response> {
Box::pin( Box::pin(
next.run(ctx, stream).with_context( next.run(ctx, stream)
OpenTelemetryContext::current_with_span( .with_context(OpenTelemetryContext::current_with_span(
self.tracer self.tracer
.span_builder("subscribe") .span_builder("subscribe")
.with_kind(SpanKind::Server) .with_kind(SpanKind::Server)
.start(&*self.tracer), .start(&*self.tracer),
), )),
),
) )
} }