Skip to content

Commit 2e2ccf3

Browse files
committed
Run rustfmt
1 parent 4fc6b64 commit 2e2ccf3

File tree

23 files changed

+38
-54
lines changed

23 files changed

+38
-54
lines changed

wundergraph/bench/queries.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const QUERIES: &[&str] = &[
7474
}
7575
}
7676
}"#,
77-
r#"query artists_collaboration {
77+
r#"query artists_collaboration {
7878
Artists(filter: {albums: {tracks: {composer: {eq: "Ludwig van Beethoven"}}}})
7979
{
8080
artist_id

wundergraph/src/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use diesel::Connection;
22

33
/// A trait for types that could be used as context types for wundergraph
44
pub trait WundergraphContext {
5-
65
/// The underlying connection type
76
type Connection: Connection + 'static;
87

wundergraph/src/helper/tuple.rs

-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ pub trait IsPrimaryKeyIndex {
1515
/// let _a: <(i32, &str, f64) as TupleIndex<TupleIndex1>>::Value = "foo";
1616
/// ```
1717
pub trait TupleIndex<N> {
18-
1918
/// The type of the indexed tuple value
2019
type Value;
2120

@@ -28,7 +27,6 @@ pub trait TupleIndex<N> {
2827
/// `Self` represents the existing tuple, `Other` the tuple that should be
2928
/// appended
3029
pub trait ConcatTuples<Other> {
31-
3230
/// The resulting tuple type
3331
type Out;
3432
}

wundergraph/src/macros/query.rs

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ macro_rules! __expand_limit {
3232
};
3333
}
3434

35-
3635
#[doc(hidden)]
3736
#[macro_export]
3837
macro_rules! __expand_offset {

wundergraph/src/query_builder/mutations/insert/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ pub trait HandleInsert<L, I, DB, Ctx> {
103103
/// A default implementation is provided for all types implementing
104104
/// `diesel::Insertable`
105105
pub trait HandleBatchInsert<L, I, DB, Ctx> {
106-
107106
/// Actual function called to insert a batch of database entity
108107
fn handle_batch_insert(
109108
selection: Option<&'_ [Selection<'_, WundergraphScalarValue>]>,

wundergraph/src/query_builder/mutations/insert/pg.rs

+6-16
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ where
2626
T::FromClause: QueryFragment<Pg>,
2727
L: LoadingHandler<Pg, Ctx, Table = T> + 'static,
2828
L::Columns: BuildOrder<T, Pg>
29-
+ BuildSelect<
30-
T,
31-
Pg,
32-
SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>,
33-
>,
29+
+ BuildSelect<T, Pg, SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
3430
Ctx: WundergraphContext + QueryModifier<L, Pg>,
3531
Ctx::Connection: Connection<Backend = Pg>,
3632
L::FieldList: WundergraphFieldList<Pg, L::PrimaryKeyIndex, T, Ctx>,
@@ -42,9 +38,8 @@ where
4238
Pg,
4339
Output = BoxedSelectStatement<'static, SqlTypeOf<<T as Table>::AllColumns>, T, Pg>,
4440
>,
45-
<Ctx::Connection as Connection>::Backend:
46-
HasSqlType<SqlTypeOf<T::PrimaryKey>>
47-
+ HasSqlType<SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
41+
<Ctx::Connection as Connection>::Backend: HasSqlType<SqlTypeOf<T::PrimaryKey>>
42+
+ HasSqlType<SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
4843
<L::Filter as BuildFilter<Pg>>::Ret: AppearsOnTable<T>,
4944
T::PrimaryKey: EqAll<Id>,
5045
&'static L: Identifiable,
@@ -84,11 +79,7 @@ where
8479
T::FromClause: QueryFragment<Pg>,
8580
L: LoadingHandler<Pg, Ctx, Table = T> + 'static,
8681
L::Columns: BuildOrder<T, Pg>
87-
+ BuildSelect<
88-
T,
89-
Pg,
90-
SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>,
91-
>,
82+
+ BuildSelect<T, Pg, SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
9283
Ctx: WundergraphContext + QueryModifier<L, Pg>,
9384
Ctx::Connection: Connection<Backend = Pg>,
9485
L::FieldList: WundergraphFieldList<Pg, L::PrimaryKeyIndex, T, Ctx>,
@@ -100,9 +91,8 @@ where
10091
Pg,
10192
Output = BoxedSelectStatement<'static, SqlTypeOf<<T as Table>::AllColumns>, T, Pg>,
10293
>,
103-
<Ctx::Connection as Connection>::Backend:
104-
HasSqlType<SqlTypeOf<T::PrimaryKey>>
105-
+ HasSqlType<SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
94+
<Ctx::Connection as Connection>::Backend: HasSqlType<SqlTypeOf<T::PrimaryKey>>
95+
+ HasSqlType<SqlTypeOfPlaceholder<L::FieldList, Pg, L::PrimaryKeyIndex, T, Ctx>>,
10696
<L::Filter as BuildFilter<Pg>>::Ret: AppearsOnTable<T>,
10797
T::PrimaryKey: EqAll<Id>,
10898
&'static L: Identifiable,

wundergraph/src/query_builder/mutations/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ pub use self::update::HandleUpdate;
8181
#[doc(hidden)]
8282
pub use self::delete::handle_delete;
8383
#[doc(hidden)]
84-
pub use self::insert::{handle_insert, handle_batch_insert};
84+
pub use self::insert::{handle_batch_insert, handle_insert};
8585
#[doc(hidden)]
8686
pub use self::update::handle_update;

wundergraph/src/query_builder/mutations/update.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ where
7979
T::FromClause: QueryFragment<DB>,
8080
L: LoadingHandler<DB, Ctx, Table = T>,
8181
L::Columns: BuildOrder<T, DB>
82-
+ BuildSelect<
83-
T,
84-
DB,
85-
SqlTypeOfPlaceholder<L::FieldList, DB, L::PrimaryKeyIndex, T, Ctx>,
86-
>,
82+
+ BuildSelect<T, DB, SqlTypeOfPlaceholder<L::FieldList, DB, L::PrimaryKeyIndex, T, Ctx>>,
8783
Ctx: WundergraphContext + QueryModifier<L, DB>,
8884
Ctx::Connection: Connection<Backend = DB>,
8985
L::FieldList: WundergraphFieldList<DB, L::PrimaryKeyIndex, T, Ctx>,

wundergraph/src/query_builder/selection/fields/field_list.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::{FieldListExtractor, NonTableFieldExtractor, WundergraphResolveAssociations};
22
use crate::context::WundergraphContext;
3+
use crate::error::Result;
4+
use crate::helper::tuple::TupleIndex;
5+
use crate::query_builder::selection::query_resolver::WundergraphResolvePlaceHolderList;
36
use crate::query_builder::types::placeholder::PlaceHolderMarker;
47
use crate::query_builder::types::WundergraphValue;
5-
use crate::query_builder::selection::query_resolver::WundergraphResolvePlaceHolderList;
6-
use crate::helper::tuple::TupleIndex;
78
use crate::scalar::WundergraphScalarValue;
8-
use crate::error::Result;
99
use diesel::backend::Backend;
1010
use diesel::{Connection, Queryable};
1111
use juniper::{Executor, Selection};

wundergraph/src/query_builder/selection/filter/common_filter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::collector::{AndCollector, FilterCollector};
33
use super::filter_value::FilterValue;
44
use super::inner_filter::InnerFilter;
55
use crate::diesel_ext::BoxableFilter;
6-
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
6+
use crate::juniper_ext::{FromLookAheadValue, NameBuilder, Nameable};
77
use crate::scalar::WundergraphScalarValue;
88
use diesel::backend::Backend;
99
use diesel::expression::array_comparison::{In, Many};

wundergraph/src/query_builder/selection/filter/not.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::BuildFilter;
2-
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
2+
use crate::juniper_ext::{FromLookAheadValue, NameBuilder, Nameable};
33
use crate::scalar::WundergraphScalarValue;
44
use diesel::backend::Backend;
55
use diesel::dsl;

wundergraph/src/query_builder/selection/filter/nullable_filter/filter_option.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::diesel_ext::BoxableFilter;
2-
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
2+
use crate::juniper_ext::{FromLookAheadValue, NameBuilder, Nameable};
33
use crate::query_builder::selection::filter::build_filter::BuildFilter;
44
use crate::query_builder::selection::filter::collector::{AndCollector, FilterCollector};
55
use crate::query_builder::selection::filter::filter_value::FilterValue;

wundergraph/src/query_builder/selection/filter/reference_filter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::diesel_ext::BoxableFilter;
2-
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
2+
use crate::juniper_ext::{FromLookAheadValue, NameBuilder, Nameable};
33
use crate::query_builder::selection::filter::build_filter::BuildFilter;
44
use crate::query_builder::selection::filter::collector::{AndCollector, FilterCollector};
55
use crate::query_builder::selection::filter::inner_filter::InnerFilter;

wundergraph/src/query_builder/selection/filter/string_filter/like.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<C> Like<C> {
1919
}
2020
}
2121

22-
impl<C> Clone for Like<C> where {
22+
impl<C> Clone for Like<C> {
2323
fn clone(&self) -> Self {
2424
Self(self.0.clone(), PhantomData)
2525
}

wundergraph/src/query_builder/selection/filter/string_filter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::diesel_ext::BoxableFilter;
2-
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
2+
use crate::juniper_ext::{FromLookAheadValue, NameBuilder, Nameable};
33
use crate::query_builder::selection::filter::build_filter::BuildFilter;
44
use crate::query_builder::selection::filter::inner_filter::InnerFilter;
55
use crate::scalar::WundergraphScalarValue;

wundergraph/src/query_builder/selection/query_modifier.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use super::{BoxedQuery, LoadingHandler};
22
use crate::context::WundergraphContext;
3+
use crate::error::Result;
34
use crate::query_builder::selection::offset::ApplyOffset;
45
use crate::scalar::WundergraphScalarValue;
5-
use crate::error::Result;
66
use diesel::backend::Backend;
77
use diesel::query_builder::QueryFragment;
88
use diesel::{Connection, QuerySource};

wundergraph/src/scalar.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
//! integers
66
77
use juniper::parser::{ParseError, ScalarToken, Token};
8-
use juniper::{graphql_scalar, InputValue, ParseScalarResult, ScalarValue, Value, GraphQLScalarValue};
8+
use juniper::{
9+
graphql_scalar, GraphQLScalarValue, InputValue, ParseScalarResult, ScalarValue, Value,
10+
};
911
use serde::de;
1012
use std::fmt;
1113

wundergraph/tests/helper.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use wundergraph::scalar::WundergraphScalarValue;
1212
use wundergraph_bench::api::{Mutation as BenchMutation, Query as BenchQuery};
1313
use wundergraph_bench::Schema as BenchSchema;
1414
use wundergraph_example::mutations::Mutation as ExampleMutation;
15-
use wundergraph_example::{Query as ExampleQuery, Schema as ExampleSchema, MyContext};
15+
use wundergraph_example::{MyContext, Query as ExampleQuery, Schema as ExampleSchema};
1616

1717
lazy_static! {
1818
static ref MIGRATION_LOCK: Mutex<()> = Mutex::new(());

wundergraph/tests/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ extern crate insta;
1212

1313
mod helper;
1414

15+
mod alias;
16+
mod limit_offset;
17+
mod mutations;
18+
mod order;
1519
mod query;
1620
mod query_nested;
1721
mod simple;
18-
mod order;
19-
mod limit_offset;
2022
mod type_checking;
21-
mod alias;
22-
mod mutations;
2323

2424
#[cfg(feature = "postgres")]
2525
type DbConnection = diesel::pg::PgConnection;

wundergraph/tests/mutations/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
mod create;
3-
mod update;
42
mod delete;
3+
mod update;

wundergraph_cli/src/database.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ impl InferConnection {
7777
}
7878
#[cfg(feature = "mysql")]
7979
Backend::Mysql => MysqlConnection::establish(database_url).map(InferConnection::Mysql),
80-
}.map_err(Into::into)
80+
}
81+
.map_err(Into::into)
8182
}
8283
}
8384

wundergraph_cli/src/infer_schema_internals/information_schema.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ use super::data_structures::*;
1414
use super::table_data::TableName;
1515

1616
pub trait UsesInformationSchema: Backend {
17-
type TypeColumn: SelectableExpression<
18-
self::information_schema::columns::table,
19-
SqlType = sql_types::Text,
20-
> + NonAggregate
17+
type TypeColumn: SelectableExpression<self::information_schema::columns::table, SqlType = sql_types::Text>
18+
+ NonAggregate
2119
+ QueryId
2220
+ QueryFragment<Self>;
2321

wundergraph_cli/src/infer_schema_internals/mysql.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@ pub fn load_foreign_key_constraints(
5454
kcu::table.on(tc::constraint_schema
5555
.eq(kcu::constraint_schema)
5656
.and(tc::constraint_name.eq(kcu::constraint_name))),
57-
).select((
57+
)
58+
.select((
5859
(kcu::table_name, kcu::table_schema),
5960
(kcu::referenced_table_name, kcu::referenced_table_schema),
6061
kcu::column_name,
6162
kcu::referenced_column_name,
62-
)).load::<(TableName, TableName, _, _)>(connection)?
63+
))
64+
.load::<(TableName, TableName, _, _)>(connection)?
6365
.into_iter()
6466
.map(
6567
|(mut child_table, mut parent_table, foreign_key, primary_key)| {
@@ -72,7 +74,8 @@ pub fn load_foreign_key_constraints(
7274
primary_key,
7375
}
7476
},
75-
).collect();
77+
)
78+
.collect();
7679
Ok(constraints)
7780
}
7881

0 commit comments

Comments
 (0)