Skip to content

Commit

Permalink
Change feature to "arbitrary1".
Browse files Browse the repository at this point in the history
  • Loading branch information
LegNeato committed Nov 3, 2023
1 parent 29889f6 commit a90a1f5
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 41 deletions.
2 changes: 1 addition & 1 deletion juniper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
22 changes: 11 additions & 11 deletions juniper/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub enum Type<'a> {
NonNullList(Box<Type<'a>>, Option<usize>),
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a> arbitrary::Arbitrary<'a> for Type<'a> {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
let num_choices = 4;
Expand Down Expand Up @@ -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<S = DefaultScalarValue> {
Null,
Scalar(S),
Expand All @@ -75,7 +75,7 @@ pub struct VariableDefinition<'a, S> {
pub directives: Option<Vec<Spanning<Directive<'a, S>>>>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for VariableDefinition<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -99,7 +99,7 @@ pub struct Arguments<'a, S> {
pub items: Vec<(Spanning<&'a str>, Spanning<InputValue<S>>)>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for Arguments<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -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>,
Expand All @@ -137,7 +137,7 @@ pub struct Field<'a, S> {
pub selection_set: Option<Vec<Selection<'a, S>>>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for Field<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -166,7 +166,7 @@ pub struct FragmentSpread<'a, S> {
pub directives: Option<Vec<Spanning<Directive<'a, S>>>>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for FragmentSpread<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -187,7 +187,7 @@ pub struct InlineFragment<'a, S> {
pub selection_set: Vec<Selection<'a, S>>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for InlineFragment<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -228,7 +228,7 @@ pub enum Selection<'a, S = DefaultScalarValue> {
InlineFragment(Spanning<InlineFragment<'a, S>>),
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for Selection<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -253,7 +253,7 @@ pub struct Directive<'a, S> {
pub arguments: Option<Spanning<Arguments<'a, S>>>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for Directive<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions juniper/src/parser/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions juniper/src/parser/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<T> {
/// The wrapped item
pub item: T,
Expand Down
32 changes: 16 additions & 16 deletions juniper/src/schema/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -62,7 +62,7 @@ pub type InputValueParseFn<S> = for<'b> fn(&'b InputValue<S>) -> Result<(), Fiel
pub type ScalarTokenParseFn<S> = for<'b> fn(ScalarToken<'b>) -> Result<S, ParseError>;


#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for ScalarMeta<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -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>,
Expand All @@ -132,15 +132,15 @@ 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>,
}

/// 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>,
Expand All @@ -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>,
Expand All @@ -164,7 +164,7 @@ pub struct EnumMeta<'a, S> {
pub(crate) try_parse_fn: InputValueParseFn<S>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for EnumMeta<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -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>,
Expand All @@ -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>,
Expand All @@ -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>,
Expand All @@ -241,7 +241,7 @@ pub struct InputObjectMeta<'a, S> {
pub(crate) try_parse_fn: InputValueParseFn<S>,
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S> arbitrary::Arbitrary<'a> for InputObjectMeta<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -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>,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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
///
Expand Down
10 changes: 5 additions & 5 deletions juniper/src/schema/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -147,7 +147,7 @@ pub enum TypeType<'a, S: 'a> {
List(Box<TypeType<'a, S>>, Option<usize>),
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, S: 'a> arbitrary::Arbitrary<'a> for TypeType<'a, S>
where
S: arbitrary::Arbitrary<'a>,
Expand All @@ -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<String>,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion juniper/src/types/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions juniper/src/types/scalars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ impl<T> Default for EmptyMutation<T> {
}
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, T> arbitrary::Arbitrary<'a> for EmptyMutation<T>
where
T: arbitrary::Arbitrary<'a>,
Expand Down Expand Up @@ -472,7 +472,7 @@ impl<T> Default for EmptySubscription<T> {
}
}

#[cfg(feature = "arbitrary")]
#[cfg(feature = "arbitrary1")]
impl<'a, T> arbitrary::Arbitrary<'a> for EmptySubscription<T>
where
T: arbitrary::Arbitrary<'a>,
Expand Down
2 changes: 1 addition & 1 deletion juniper/src/value/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a90a1f5

Please sign in to comment.