Fix formatting and import for nightly (#4716)
This commit is contained in:
parent
5da3a642a2
commit
fcdc37227e
4 changed files with 42 additions and 6 deletions
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
|
@ -52,8 +52,6 @@ jobs:
|
|||
steps:
|
||||
- name: Install stable toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
|
@ -73,6 +71,37 @@ jobs:
|
|||
- name: Check workspace
|
||||
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:
|
||||
name: Check fuzzing
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -7,6 +7,11 @@ category = "CI - CHECK"
|
|||
command = "cargo"
|
||||
args = ["check", "--locked", "--workspace"]
|
||||
|
||||
[tasks.ci-check-release]
|
||||
category = "CI - CHECK"
|
||||
command = "cargo"
|
||||
args = ["check", "--release", "--locked", "--workspace"]
|
||||
|
||||
[tasks.ci-check-wasm]
|
||||
category = "CI - CHECK"
|
||||
command = "cargo"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
use std::mem;
|
||||
|
||||
use crate::sql::{
|
||||
statements::UseStatement, Cond, Ident, Idiom, Limit, Order, Orders, Part, Start, Table, Value,
|
||||
};
|
||||
use async_graphql::dynamic::Scalar;
|
||||
|
||||
pub trait IntoExt<T> {
|
||||
fn intox(self) -> T;
|
||||
|
@ -121,6 +118,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
pub trait ValidatorExt {
|
||||
fn add_validator(
|
||||
&mut self,
|
||||
|
@ -128,13 +126,16 @@ pub trait ValidatorExt {
|
|||
) -> &mut Self;
|
||||
}
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
use async_graphql::dynamic::Scalar;
|
||||
#[cfg(debug_assertions)]
|
||||
impl ValidatorExt for Scalar {
|
||||
fn add_validator(
|
||||
&mut self,
|
||||
validator: impl Fn(&async_graphql::Value) -> bool + Send + Sync + 'static,
|
||||
) -> &mut Self {
|
||||
let mut tmp = Scalar::new("");
|
||||
mem::swap(self, &mut tmp);
|
||||
std::mem::swap(self, &mut tmp);
|
||||
*self = tmp.validator(validator);
|
||||
self
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ use serde_json::Number;
|
|||
|
||||
use super::error::{resolver_error, GqlError};
|
||||
use super::ext::IntoExt;
|
||||
#[cfg(debug_assertions)]
|
||||
use super::ext::ValidatorExt;
|
||||
use crate::gql::error::{internal_error, schema_error, type_error};
|
||||
use crate::gql::ext::TryAsExt;
|
||||
|
|
Loading…
Reference in a new issue