Fix formatting and import for nightly (#4716)

This commit is contained in:
Raphael Darley 2024-09-09 16:22:55 +01:00 committed by GitHub
parent 5da3a642a2
commit fcdc37227e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 6 deletions

View file

@ -52,8 +52,6 @@ jobs:
steps: steps:
- name: Install stable toolchain - name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -73,6 +71,37 @@ jobs:
- name: Check workspace - name: Check workspace
run: cargo make ci-check run: cargo make ci-check
- name: Check workspace release
run: cargo make ci-check-release
check-msrv:
name: Check workspace MSRV
runs-on: ubuntu-latest
steps:
- name: Install MSRV toolchain
uses: dtolnay/rust-toolchain@1.80.1
- name: Checkout sources
uses: actions/checkout@v4
- name: Setup cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install dependencies
run: |
sudo apt-get -y update
- name: Install cargo-make
run: cargo install --debug --locked cargo-make
- name: Check workspace on MSRV
run: cargo make ci-check
- name: Check workspace release on MSRV
run: cargo make ci-check-release
check-fuzzing: check-fuzzing:
name: Check fuzzing name: Check fuzzing
runs-on: ubuntu-latest runs-on: ubuntu-latest

View file

@ -7,6 +7,11 @@ category = "CI - CHECK"
command = "cargo" command = "cargo"
args = ["check", "--locked", "--workspace"] args = ["check", "--locked", "--workspace"]
[tasks.ci-check-release]
category = "CI - CHECK"
command = "cargo"
args = ["check", "--release", "--locked", "--workspace"]
[tasks.ci-check-wasm] [tasks.ci-check-wasm]
category = "CI - CHECK" category = "CI - CHECK"
command = "cargo" command = "cargo"

View file

@ -1,9 +1,6 @@
use std::mem;
use crate::sql::{ use crate::sql::{
statements::UseStatement, Cond, Ident, Idiom, Limit, Order, Orders, Part, Start, Table, Value, statements::UseStatement, Cond, Ident, Idiom, Limit, Order, Orders, Part, Start, Table, Value,
}; };
use async_graphql::dynamic::Scalar;
pub trait IntoExt<T> { pub trait IntoExt<T> {
fn intox(self) -> T; fn intox(self) -> T;
@ -121,6 +118,7 @@ where
} }
} }
#[cfg(debug_assertions)]
pub trait ValidatorExt { pub trait ValidatorExt {
fn add_validator( fn add_validator(
&mut self, &mut self,
@ -128,13 +126,16 @@ pub trait ValidatorExt {
) -> &mut Self; ) -> &mut Self;
} }
#[cfg(debug_assertions)]
use async_graphql::dynamic::Scalar;
#[cfg(debug_assertions)]
impl ValidatorExt for Scalar { impl ValidatorExt for Scalar {
fn add_validator( fn add_validator(
&mut self, &mut self,
validator: impl Fn(&async_graphql::Value) -> bool + Send + Sync + 'static, validator: impl Fn(&async_graphql::Value) -> bool + Send + Sync + 'static,
) -> &mut Self { ) -> &mut Self {
let mut tmp = Scalar::new(""); let mut tmp = Scalar::new("");
mem::swap(self, &mut tmp); std::mem::swap(self, &mut tmp);
*self = tmp.validator(validator); *self = tmp.validator(validator);
self self
} }

View file

@ -26,6 +26,7 @@ use serde_json::Number;
use super::error::{resolver_error, GqlError}; use super::error::{resolver_error, GqlError};
use super::ext::IntoExt; use super::ext::IntoExt;
#[cfg(debug_assertions)]
use super::ext::ValidatorExt; use super::ext::ValidatorExt;
use crate::gql::error::{internal_error, schema_error, type_error}; use crate::gql::error::{internal_error, schema_error, type_error};
use crate::gql::ext::TryAsExt; use crate::gql::ext::TryAsExt;