Skip to content

Commit 05f309c

Browse files
committed
update ci
1 parent c52e89e commit 05f309c

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,11 @@ jobs:
2121
if: "github.repository == 'graphql-rust/graphql-client'"
2222
steps:
2323
- name: Checkout sources
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525
- name: Install toolchain
26-
uses: actions-rs/toolchain@v1
26+
uses: dtolnay/rust-toolchain@master
2727
with:
28-
profile: minimal
2928
toolchain: ${{ matrix.rust }}
30-
override: true
3129
- name: Execute cargo test
3230
run: cargo test --all --tests --examples
3331
wasm_build:
@@ -36,13 +34,10 @@ jobs:
3634
if: "github.repository == 'graphql-rust/graphql-client'"
3735
steps:
3836
- name: Checkout sources
39-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
4038
- name: Install toolchain
41-
uses: actions-rs/toolchain@v1
39+
uses: dtolnay/rust-toolchain@stable
4240
with:
43-
profile: minimal
44-
toolchain: stable
45-
override: true
4641
target: wasm32-unknown-unknown
4742
- name: Execute cargo build
4843
run: |
@@ -53,25 +48,22 @@ jobs:
5348
if: "github.repository == 'graphql-rust/graphql-client'"
5449
steps:
5550
- name: Checkout sources
56-
uses: actions/checkout@v2
51+
uses: actions/checkout@v4
5752
- name: Install toolchain
58-
uses: actions-rs/toolchain@v1
53+
uses: dtolnay/rust-toolchain@stable
5954
with:
60-
profile: minimal
61-
toolchain: stable
62-
override: true
6355
components: clippy,rustfmt
6456
- name: Execute cargo fmt
6557
run: cargo fmt --all -- --check
6658
- name: Execute cargo clippy
67-
run: cargo clippy --tests --examples -- -D warnings
59+
run: cargo clippy --all --all-targets --all-features -- -D warnings
6860
prettier:
6961
name: Check prettier
7062
runs-on: ubuntu-latest
7163
if: "github.repository == 'graphql-rust/graphql-client'"
7264
steps:
7365
- name: Checkout sources
74-
uses: actions/checkout@v2
66+
uses: actions/checkout@v4
7567
- name: Install node.js
7668
run: sudo apt update && sudo apt-get install -y nodejs
7769
- name: Execute prettier

graphql_client_codegen/src/codegen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn generate_variables_struct(
9999
variable
100100
.r#type
101101
.qualifiers
102-
.get(0)
102+
.first()
103103
.map(|qual| !qual.is_required())
104104
.unwrap_or(true),
105105
query,

graphql_client_codegen/src/codegen/selection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn calculate_selection<'a>(
186186
})
187187
.collect();
188188

189-
if let Some((selection_id, selection, _variant)) = variant_selections.get(0) {
189+
if let Some((selection_id, selection, _variant)) = variant_selections.first() {
190190
let mut variant_struct_name_str =
191191
full_path_prefix(*selection_id, context.query);
192192
variant_struct_name_str.reserve(2 + variant_name_str.len());
@@ -408,7 +408,7 @@ impl<'a> ExpandedField<'a> {
408408
let optional_skip_serializing_none = if *options.skip_serializing_none()
409409
&& self
410410
.field_type_qualifiers
411-
.get(0)
411+
.first()
412412
.map(|qualifier| !qualifier.is_required())
413413
.unwrap_or(false)
414414
{

graphql_client_codegen/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl StoredInputFieldType {
200200

201201
pub(crate) fn is_optional(&self) -> bool {
202202
self.qualifiers
203-
.get(0)
203+
.first()
204204
.map(|qualifier| !qualifier.is_required())
205205
.unwrap_or(true)
206206
}

0 commit comments

Comments
 (0)