Skip to content

Commit f8b34dc

Browse files
committed
remove imports
1 parent f8fbdd5 commit f8b34dc

1 file changed

Lines changed: 19 additions & 22 deletions

File tree

diesel/src/macros/mod.rs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,6 @@ macro_rules! __diesel_table_impl {
609609
$($meta)*
610610
pub mod $table_name {
611611
#![allow(dead_code)]
612-
use $crate::{
613-
QuerySource,
614-
Table,
615-
JoinTo,
616-
};
617612
$($imports)*
618613
pub use self::columns::*;
619614

@@ -680,7 +675,7 @@ macro_rules! __diesel_table_impl {
680675
}
681676
}
682677

683-
impl Table for table {
678+
impl $crate::Table for table {
684679
type PrimaryKey = $primary_key;
685680
type AllColumns = ($($column_name,)+);
686681

@@ -718,47 +713,47 @@ macro_rules! __diesel_table_impl {
718713
type Count = $crate::query_source::Never;
719714
}
720715

721-
impl<Left, Right, Kind> JoinTo<$crate::query_source::joins::Join<Left, Right, Kind>> for table where
722-
$crate::query_source::joins::Join<Left, Right, Kind>: JoinTo<table>,
716+
impl<Left, Right, Kind> $crate::JoinTo<$crate::query_source::joins::Join<Left, Right, Kind>> for table where
717+
$crate::query_source::joins::Join<Left, Right, Kind>: $crate::JoinTo<table>,
723718
{
724719
type FromClause = $crate::query_source::joins::Join<Left, Right, Kind>;
725-
type OnClause = <$crate::query_source::joins::Join<Left, Right, Kind> as JoinTo<table>>::OnClause;
720+
type OnClause = <$crate::query_source::joins::Join<Left, Right, Kind> as $crate::JoinTo<table>>::OnClause;
726721

727722
fn join_target(rhs: $crate::query_source::joins::Join<Left, Right, Kind>) -> (Self::FromClause, Self::OnClause) {
728723
let (_, on_clause) = $crate::query_source::joins::Join::join_target(table);
729724
(rhs, on_clause)
730725
}
731726
}
732727

733-
impl<Join, On> JoinTo<$crate::query_source::joins::JoinOn<Join, On>> for table where
734-
$crate::query_source::joins::JoinOn<Join, On>: JoinTo<table>,
728+
impl<Join, On> $crate::JoinTo<$crate::query_source::joins::JoinOn<Join, On>> for table where
729+
$crate::query_source::joins::JoinOn<Join, On>: $crate::JoinTo<table>,
735730
{
736731
type FromClause = $crate::query_source::joins::JoinOn<Join, On>;
737-
type OnClause = <$crate::query_source::joins::JoinOn<Join, On> as JoinTo<table>>::OnClause;
732+
type OnClause = <$crate::query_source::joins::JoinOn<Join, On> as $crate::JoinTo<table>>::OnClause;
738733

739734
fn join_target(rhs: $crate::query_source::joins::JoinOn<Join, On>) -> (Self::FromClause, Self::OnClause) {
740735
let (_, on_clause) = $crate::query_source::joins::JoinOn::join_target(table);
741736
(rhs, on_clause)
742737
}
743738
}
744739

745-
impl<F, S, D, W, O, L, Of, G> JoinTo<$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>> for table where
746-
$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>: JoinTo<table>,
740+
impl<F, S, D, W, O, L, Of, G> $crate::JoinTo<$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>> for table where
741+
$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>: $crate::JoinTo<table>,
747742
{
748743
type FromClause = $crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>;
749-
type OnClause = <$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G> as JoinTo<table>>::OnClause;
744+
type OnClause = <$crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G> as $crate::JoinTo<table>>::OnClause;
750745

751746
fn join_target(rhs: $crate::query_builder::SelectStatement<F, S, D, W, O, L, Of, G>) -> (Self::FromClause, Self::OnClause) {
752747
let (_, on_clause) = $crate::query_builder::SelectStatement::join_target(table);
753748
(rhs, on_clause)
754749
}
755750
}
756751

757-
impl<'a, QS, ST, DB> JoinTo<$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>> for table where
758-
$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>: JoinTo<table>,
752+
impl<'a, QS, ST, DB> $crate::JoinTo<$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>> for table where
753+
$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>: $crate::JoinTo<table>,
759754
{
760755
type FromClause = $crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>;
761-
type OnClause = <$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB> as JoinTo<table>>::OnClause;
756+
type OnClause = <$crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB> as $crate::JoinTo<table>>::OnClause;
762757
fn join_target(rhs: $crate::query_builder::BoxedSelectStatement<'a, QS, ST, DB>) -> (Self::FromClause, Self::OnClause) {
763758
let (_, on_clause) = $crate::query_builder::BoxedSelectStatement::join_target(table);
764759
(rhs, on_clause)
@@ -848,28 +843,29 @@ macro_rules! __diesel_table_impl {
848843
#[doc(hidden)]
849844
macro_rules! __diesel_table_query_source_impl {
850845
($table_struct:ident, public, $table_name:expr) => {
851-
impl QuerySource for $table_struct {
846+
impl $crate::QuerySource for $table_struct {
852847
type FromClause = $crate::query_builder::nodes::Identifier<'static>;
853-
type DefaultSelection = <Self as Table>::AllColumns;
848+
type DefaultSelection = <Self as $crate::Table>::AllColumns;
854849

855850
fn from_clause(&self) -> Self::FromClause {
856851
$crate::query_builder::nodes::Identifier($table_name)
857852
}
858853

859854
fn default_selection(&self) -> Self::DefaultSelection {
855+
use $crate::Table;
860856
Self::all_columns()
861857
}
862858
}
863859
};
864860

865861
($table_struct:ident, $schema_name:ident, $table_name:expr) => {
866-
impl QuerySource for $table_struct {
862+
impl $crate::QuerySource for $table_struct {
867863
type FromClause = $crate::query_builder::nodes::InfixNode<
868864
'static,
869865
$crate::query_builder::nodes::Identifier<'static>,
870866
$crate::query_builder::nodes::Identifier<'static>,
871867
>;
872-
type DefaultSelection = <Self as Table>::AllColumns;
868+
type DefaultSelection = <Self as $crate::Table>::AllColumns;
873869

874870
fn from_clause(&self) -> Self::FromClause {
875871
$crate::query_builder::nodes::InfixNode::new(
@@ -880,6 +876,7 @@ macro_rules! __diesel_table_query_source_impl {
880876
}
881877

882878
fn default_selection(&self) -> Self::DefaultSelection {
879+
use $crate::Table;
883880
Self::all_columns()
884881
}
885882
}

0 commit comments

Comments
 (0)