Skip to content

Commit c370ed6

Browse files
committed
Merge branch 'master' into whamcloud
# Conflicts: # juniper/Cargo.toml
2 parents 6b3c75d + fb74576 commit c370ed6

File tree

11 files changed

+35
-17
lines changed

11 files changed

+35
-17
lines changed

juniper/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ fnv = "1.0.5"
5353
futures = { version = "0.3.22", features = ["alloc"], default-features = false }
5454
graphql-parser = { version = "0.4", optional = true }
5555
indexmap = { version = "2.0", features = ["serde"] }
56-
jiff = { version = "0.1.16", features = ["std"], default-features = false, optional = true }
56+
jiff = { version = "0.1.19", features = ["std"], default-features = false, optional = true }
5757
juniper_codegen = { version = "0.16.0", path = "../juniper_codegen" }
5858
rust_decimal = { version = "1.20", default-features = false, optional = true }
5959
ryu = { version = "1.0", optional = true }
@@ -78,7 +78,7 @@ void = { version = "1.0.2", optional = true }
7878
[dev-dependencies]
7979
bencher = "0.1.2"
8080
chrono = { version = "0.4.30", features = ["alloc"], default-features = false }
81-
jiff = { version = "0.1", features = ["tzdb-bundle-always"], default-features = false }
81+
jiff = { version = "0.1.19", features = ["tzdb-bundle-always"], default-features = false }
8282
pretty_assertions = "1.0.0"
8383
serde_json = "1.0.18"
8484
serial_test = "3.0"

juniper/src/integrations/jiff.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,9 +1280,9 @@ mod duration_test {
12801280
.minutes(1)
12811281
.seconds(1)
12821282
.milliseconds(100),
1283-
graphql_input_value!("P1y1m1dT1h1m1.1s"),
1283+
graphql_input_value!("P1Y1M1DT1H1M1.1S"),
12841284
),
1285-
((-5).days(), graphql_input_value!("-P5d")),
1285+
((-5).days(), graphql_input_value!("-P5D")),
12861286
] {
12871287
let actual: InputValue = val.to_input_value();
12881288

@@ -1674,7 +1674,7 @@ mod integration_test {
16741674
"zonedDateTime": "2014-11-28T12:00:09.05-05:00[America/New_York]",
16751675
"timeZone": "Asia/Tokyo",
16761676
"utcOffset": "+10:00",
1677-
"duration": "P1y1m1dT1h1m1.1s",
1677+
"duration": "P1Y1M1DT1H1M1.1S",
16781678
}),
16791679
vec![],
16801680
)),

juniper/src/macros/reflect.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,13 @@ pub const fn fnv1a128(str: Name) -> u128 {
417417
/// Length __in bytes__ of the [`format_type!`] macro result.
418418
#[must_use]
419419
pub const fn type_len_with_wrapped_val(ty: Type, val: WrappedValue) -> usize {
420-
let mut len = ty.as_bytes().len() + "!".as_bytes().len(); // Type!
420+
let mut len = ty.len() + "!".len(); // Type!
421421

422422
let mut curr = val;
423423
while curr % 10 != 0 {
424424
match curr % 10 {
425-
2 => len -= "!".as_bytes().len(), // remove !
426-
3 => len += "[]!".as_bytes().len(), // [Type]!
425+
2 => len -= "!".len(), // remove !
426+
3 => len += "[]!".len(), // [Type]!
427427
_ => {}
428428
}
429429
curr /= 10;

tests/codegen/fail/interface/struct/attr_missing_field.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ error[E0277]: the trait bound `ObjA: reflect::Field<__S, 11301463986558097276003
2828
11 | id: String,
2929
| ^^ the trait `reflect::Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3030
|
31-
= help: the trait `reflect::Field<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
31+
= help: the trait `Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
32+
but trait `Field<__S, 140650918148392961738240285796466530725>` is implemented for it
3233

3334
error[E0277]: the trait bound `ObjA: AsyncField<__S, 11301463986558097276003903130001171064>` is not satisfied
3435
--> fail/interface/struct/attr_missing_field.rs:11:5
3536
|
3637
11 | id: String,
3738
| ^^ the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3839
|
39-
= help: the trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
40+
= help: the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
41+
but trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for it

tests/codegen/fail/interface/struct/derive_missing_field.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ error[E0277]: the trait bound `ObjA: reflect::Field<__S, 11301463986558097276003
2828
12 | id: String,
2929
| ^^ the trait `reflect::Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3030
|
31-
= help: the trait `reflect::Field<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
31+
= help: the trait `Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
32+
but trait `Field<__S, 140650918148392961738240285796466530725>` is implemented for it
3233

3334
error[E0277]: the trait bound `ObjA: AsyncField<__S, 11301463986558097276003903130001171064>` is not satisfied
3435
--> fail/interface/struct/derive_missing_field.rs:12:5
3536
|
3637
12 | id: String,
3738
| ^^ the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3839
|
39-
= help: the trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
40+
= help: the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
41+
but trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for it

tests/codegen/fail/interface/trait/argument_wrong_default_array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied
22
--> fail/interface/trait/argument_wrong_default_array.rs:3:1
33
|
44
3 | #[graphql_interface]
5-
| ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`, which is required by `[bool; 3]: Into<_>`
5+
| ^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`
66
|
77
= help: the following other types implement trait `From<T>`:
88
`[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>`

tests/codegen/fail/interface/trait/missing_field.stderr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ error[E0277]: the trait bound `ObjA: reflect::Field<__S, 11301463986558097276003
2828
11 | fn id(&self) -> &str;
2929
| ^^ the trait `reflect::Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3030
|
31-
= help: the trait `reflect::Field<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
31+
= help: the trait `Field<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
32+
but trait `Field<__S, 140650918148392961738240285796466530725>` is implemented for it
3233

3334
error[E0277]: the trait bound `ObjA: AsyncField<__S, 11301463986558097276003903130001171064>` is not satisfied
3435
--> fail/interface/trait/missing_field.rs:11:8
3536
|
3637
11 | fn id(&self) -> &str;
3738
| ^^ the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
3839
|
39-
= help: the trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for `ObjA`
40+
= help: the trait `AsyncField<__S, 11301463986558097276003903130001171064>` is not implemented for `ObjA`
41+
but trait `AsyncField<__S, 140650918148392961738240285796466530725>` is implemented for it

tests/codegen/fail/object/argument_wrong_default_array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied
22
--> fail/object/argument_wrong_default_array.rs:5:1
33
|
44
5 | #[graphql_object]
5-
| ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`, which is required by `[bool; 3]: Into<_>`
5+
| ^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`
66
|
77
= help: the following other types implement trait `From<T>`:
88
`[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>`

tests/codegen/fail/subscription/argument_wrong_default_array.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `[bool; 2]: From<[bool; 3]>` is not satisfied
22
--> fail/subscription/argument_wrong_default_array.rs:10:1
33
|
44
10 | #[graphql_subscription]
5-
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`, which is required by `[bool; 3]: Into<_>`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `From<[bool; 3]>` is not implemented for `[bool; 2]`
66
|
77
= help: the following other types implement trait `From<T>`:
88
`[T; 10]` implements `From<(T, T, T, T, T, T, T, T, T, T)>`

tests/integration/tests/codegen_object_attr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ mod generic_lifetime_async {
617617
home_planet: &'p str,
618618
}
619619

620+
#[allow(clippy::needless_lifetimes)] // required by codegen
620621
#[graphql_object]
621622
impl<'p> Human<'p, i32> {
622623
async fn id(&self) -> i32 {
@@ -628,6 +629,7 @@ mod generic_lifetime_async {
628629
}
629630
}
630631

632+
#[allow(clippy::needless_lifetimes)] // required by codegen
631633
#[graphql_object(name = "HumanString")]
632634
impl<'id, 'p> Human<'p, &'id str> {
633635
async fn id(&self) -> &str {
@@ -724,6 +726,7 @@ mod nested_generic_lifetime_async {
724726
primary_function: &'p str,
725727
}
726728

729+
#[allow(clippy::needless_lifetimes)] // required by codegen
727730
#[graphql_object]
728731
impl<'p> Droid<'p, i32> {
729732
async fn id(&self) -> i32 {
@@ -735,6 +738,7 @@ mod nested_generic_lifetime_async {
735738
}
736739
}
737740

741+
#[allow(clippy::needless_lifetimes)] // required by codegen
738742
#[graphql_object(name = "DroidString")]
739743
impl<'id, 'p> Droid<'p, &'id str> {
740744
async fn id(&self) -> &str {
@@ -751,6 +755,7 @@ mod nested_generic_lifetime_async {
751755
home_planet: &'p str,
752756
}
753757

758+
#[allow(clippy::needless_lifetimes)] // required by codegen
754759
#[graphql_object]
755760
impl<'p> Human<'p, i32> {
756761
async fn id(&self) -> i32 {
@@ -769,6 +774,7 @@ mod nested_generic_lifetime_async {
769774
}
770775
}
771776

777+
#[allow(clippy::needless_lifetimes)] // required by codegen
772778
#[graphql_object(name = "HumanString")]
773779
impl<'id, 'p> Human<'p, &'id str> {
774780
async fn id(&self) -> &str {

0 commit comments

Comments
 (0)