From a90a1f52909d49d95a97313ce41132e608dcbe02 Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Mon, 28 Feb 2022 21:23:00 -1000 Subject: [PATCH] Change feature to "arbitrary1". --- juniper/Cargo.toml | 2 +- juniper/src/ast.rs | 22 +++++++++++----------- juniper/src/parser/lexer.rs | 4 ++-- juniper/src/parser/utils.rs | 4 ++-- juniper/src/schema/meta.rs | 32 ++++++++++++++++---------------- juniper/src/schema/model.rs | 10 +++++----- juniper/src/types/name.rs | 2 +- juniper/src/types/scalars.rs | 4 ++-- juniper/src/value/scalar.rs | 2 +- 9 files changed, 41 insertions(+), 41 deletions(-) diff --git a/juniper/Cargo.toml b/juniper/Cargo.toml index 6f7e5b827..6d22a4631 100644 --- a/juniper/Cargo.toml +++ b/juniper/Cargo.toml @@ -31,7 +31,7 @@ default = [ "url", "uuid", ] -arbitrary = ["dep:arbitrary", "smartstring/arbitrary"] +arbitrary1 = ["dep:arbitrary", "smartstring/arbitrary"] bigdecimal = ["dep:bigdecimal", "dep:num-bigint", "dep:ryu"] bson = ["dep:bson"] chrono = ["dep:chrono"] diff --git a/juniper/src/ast.rs b/juniper/src/ast.rs index 268d676c4..86ea45448 100644 --- a/juniper/src/ast.rs +++ b/juniper/src/ast.rs @@ -28,7 +28,7 @@ pub enum Type<'a> { NonNullList(Box>, Option), } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a> arbitrary::Arbitrary<'a> for Type<'a> { fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { let num_choices = 4; @@ -57,7 +57,7 @@ impl<'a> arbitrary::Arbitrary<'a> for Type<'a> { /// Lists and objects variants are _spanned_, i.e. they contain a reference to /// their position in the source file, if available. #[derive(Clone, Debug, PartialEq)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub enum InputValue { Null, Scalar(S), @@ -75,7 +75,7 @@ pub struct VariableDefinition<'a, S> { pub directives: Option>>>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for VariableDefinition<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -99,7 +99,7 @@ pub struct Arguments<'a, S> { pub items: Vec<(Spanning<&'a str>, Spanning>)>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for Arguments<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -116,7 +116,7 @@ pub struct VariableDefinitions<'a, S> { pub items: Vec<(Spanning<&'a str>, VariableDefinition<'a, S>)>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for VariableDefinitions<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -137,7 +137,7 @@ pub struct Field<'a, S> { pub selection_set: Option>>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for Field<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -166,7 +166,7 @@ pub struct FragmentSpread<'a, S> { pub directives: Option>>>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for FragmentSpread<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -187,7 +187,7 @@ pub struct InlineFragment<'a, S> { pub selection_set: Vec>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for InlineFragment<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -228,7 +228,7 @@ pub enum Selection<'a, S = DefaultScalarValue> { InlineFragment(Spanning>), } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for Selection<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -253,7 +253,7 @@ pub struct Directive<'a, S> { pub arguments: Option>>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for Directive<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -267,7 +267,7 @@ where #[allow(missing_docs)] #[derive(Clone, Copy, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub enum OperationType { Query, Mutation, diff --git a/juniper/src/parser/lexer.rs b/juniper/src/parser/lexer.rs index 9d16c457e..ae053b271 100644 --- a/juniper/src/parser/lexer.rs +++ b/juniper/src/parser/lexer.rs @@ -21,7 +21,7 @@ pub struct Lexer<'a> { /// /// This is only used for tagging how the lexer has interpreted a value literal #[allow(missing_docs)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ScalarToken<'a> { String(&'a str), @@ -31,7 +31,7 @@ pub enum ScalarToken<'a> { /// A single token in the input source #[allow(missing_docs)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum Token<'a> { Name(&'a str), diff --git a/juniper/src/parser/utils.rs b/juniper/src/parser/utils.rs index 0814ef9e7..c4f4b2e16 100644 --- a/juniper/src/parser/utils.rs +++ b/juniper/src/parser/utils.rs @@ -2,7 +2,7 @@ use std::fmt; /// A reference to a line and column in an input source file #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct SourcePosition { index: usize, line: usize, @@ -15,7 +15,7 @@ pub struct SourcePosition { /// character pointed by the `start` field and ending just before the `end` /// marker. #[derive(Debug, Clone, PartialEq, Eq, Hash, Copy)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct Spanning { /// The wrapped item pub item: T, diff --git a/juniper/src/schema/meta.rs b/juniper/src/schema/meta.rs index cd432b189..1785f5d30 100644 --- a/juniper/src/schema/meta.rs +++ b/juniper/src/schema/meta.rs @@ -17,7 +17,7 @@ use crate::{ /// Whether an item is deprecated, with context. #[derive(Clone, Debug, Eq, Hash, PartialEq)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub enum DeprecationStatus { /// The field/variant is not deprecated. Current, @@ -62,7 +62,7 @@ pub type InputValueParseFn = for<'b> fn(&'b InputValue) -> Result<(), Fiel pub type ScalarTokenParseFn = for<'b> fn(ScalarToken<'b>) -> Result; -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for ScalarMeta<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -121,7 +121,7 @@ where /// List type metadata #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct ListMeta<'a> { #[doc(hidden)] pub of_type: Type<'a>, @@ -132,7 +132,7 @@ pub struct ListMeta<'a> { /// Nullable type metadata #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct NullableMeta<'a> { #[doc(hidden)] pub of_type: Type<'a>, @@ -140,7 +140,7 @@ pub struct NullableMeta<'a> { /// Object type metadata #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct ObjectMeta<'a, S> { #[doc(hidden)] pub name: Cow<'a, str>, @@ -153,7 +153,7 @@ pub struct ObjectMeta<'a, S> { } /// Enum type metadata -//#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +//#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct EnumMeta<'a, S> { #[doc(hidden)] pub name: Cow<'a, str>, @@ -164,7 +164,7 @@ pub struct EnumMeta<'a, S> { pub(crate) try_parse_fn: InputValueParseFn, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for EnumMeta<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -205,7 +205,7 @@ where /// Interface type metadata #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct InterfaceMeta<'a, S> { #[doc(hidden)] pub name: Cow<'a, str>, @@ -219,7 +219,7 @@ pub struct InterfaceMeta<'a, S> { /// Union type metadata #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct UnionMeta<'a> { #[doc(hidden)] pub name: Cow<'a, str>, @@ -230,7 +230,7 @@ pub struct UnionMeta<'a> { } /// Input object metadata -//#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +//#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct InputObjectMeta<'a, S> { #[doc(hidden)] pub name: Cow<'a, str>, @@ -241,7 +241,7 @@ pub struct InputObjectMeta<'a, S> { pub(crate) try_parse_fn: InputValueParseFn, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for InputObjectMeta<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -285,7 +285,7 @@ where /// After a type's `meta` method has been called but before it has returned, a placeholder type /// is inserted into a registry to indicate existence. #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct PlaceholderMeta<'a> { #[doc(hidden)] pub of_type: Type<'a>, @@ -314,7 +314,7 @@ pub enum MetaType<'a, S = DefaultScalarValue> { Placeholder(PlaceholderMeta<'a>), } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S> arbitrary::Arbitrary<'a> for MetaType<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -340,7 +340,7 @@ where /// Metadata for a field #[derive(Debug, Clone)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct Field<'a, S> { #[doc(hidden)] pub name: smartstring::alias::String, @@ -364,7 +364,7 @@ impl<'a, S> Field<'a, S> { /// Metadata for an argument to a field #[derive(Debug, Clone)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct Argument<'a, S> { #[doc(hidden)] pub name: String, @@ -386,7 +386,7 @@ impl<'a, S> Argument<'a, S> { /// Metadata for a single value in an enum #[derive(Debug, Clone)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct EnumValue { /// The name of the enum value /// diff --git a/juniper/src/schema/model.rs b/juniper/src/schema/model.rs index cacaff9e8..a3583e41c 100644 --- a/juniper/src/schema/model.rs +++ b/juniper/src/schema/model.rs @@ -47,7 +47,7 @@ pub struct RootNode< pub schema: SchemaType<'a, S>, } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, QueryT, MutationT, SubscriptionT, S> arbitrary::Arbitrary<'a> for RootNode<'a, QueryT, MutationT, SubscriptionT, S> where @@ -97,7 +97,7 @@ pub struct SchemaType<'a, S> { impl<'a, S> Context for SchemaType<'a, S> {} -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S: 'a> arbitrary::Arbitrary<'a> for SchemaType<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -147,7 +147,7 @@ pub enum TypeType<'a, S: 'a> { List(Box>, Option), } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, S: 'a> arbitrary::Arbitrary<'a> for TypeType<'a, S> where S: arbitrary::Arbitrary<'a>, @@ -173,7 +173,7 @@ where } #[derive(Debug)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct DirectiveType<'a, S> { pub name: String, pub description: Option, @@ -183,7 +183,7 @@ pub struct DirectiveType<'a, S> { } #[derive(Clone, PartialEq, Eq, Debug, GraphQLEnum)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] #[graphql(name = "__DirectiveLocation", internal)] pub enum DirectiveLocation { Query, diff --git a/juniper/src/types/name.rs b/juniper/src/types/name.rs index 70be23bed..5e5d774b5 100644 --- a/juniper/src/types/name.rs +++ b/juniper/src/types/name.rs @@ -6,7 +6,7 @@ use std::{ }; #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] pub struct Name(String); impl Name { diff --git a/juniper/src/types/scalars.rs b/juniper/src/types/scalars.rs index 1b69827a4..81c903a48 100644 --- a/juniper/src/types/scalars.rs +++ b/juniper/src/types/scalars.rs @@ -401,7 +401,7 @@ impl Default for EmptyMutation { } } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, T> arbitrary::Arbitrary<'a> for EmptyMutation where T: arbitrary::Arbitrary<'a>, @@ -472,7 +472,7 @@ impl Default for EmptySubscription { } } -#[cfg(feature = "arbitrary")] +#[cfg(feature = "arbitrary1")] impl<'a, T> arbitrary::Arbitrary<'a> for EmptySubscription where T: arbitrary::Arbitrary<'a>, diff --git a/juniper/src/value/scalar.rs b/juniper/src/value/scalar.rs index 52c4d3073..f513d1e71 100644 --- a/juniper/src/value/scalar.rs +++ b/juniper/src/value/scalar.rs @@ -230,7 +230,7 @@ pub trait ScalarValue: /// /// [0]: https://spec.graphql.org/October2021 #[derive(Clone, Debug, PartialEq, ScalarValue, Serialize)] -#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] +#[cfg_attr(feature = "arbitrary1", derive(arbitrary::Arbitrary))] #[serde(untagged)] pub enum DefaultScalarValue { /// [`Int` scalar][0] as a signed 32‐bit numeric non‐fractional value.