cargo fmt

This commit is contained in:
Chris Tsang 2021-05-19 21:51:11 +08:00
parent 8886269616
commit ec116762a8
4 changed files with 8 additions and 10 deletions

View File

@ -42,11 +42,11 @@ pub fn expend_derive_entity(ident: Ident, attrs: Vec<Attribute>) -> syn::Result<
impl EntityTrait for #ident {
type Model = Model;
type Column = Column;
type PrimaryKey = PrimaryKey;
type Relation = Relation;
}
))

View File

@ -1,6 +1,6 @@
use crate::{
ColumnTrait, ModelTrait, PrimaryKeyOfModel, PrimaryKeyTrait, QueryHelper, RelationBuilder,
RelationTrait, RelationType, Select
RelationTrait, RelationType, Select,
};
use sea_query::{Iden, IntoValueTuple};
use std::fmt::Debug;

View File

@ -1,5 +1,5 @@
use crate::IdenStatic;
use sea_query::{Iden, IntoIden};
use crate::{IdenStatic};
use std::rc::Rc;
#[derive(Debug, Clone)]

View File

@ -220,11 +220,9 @@ fn join_condition(rel: RelationDef) -> SimpleExpr {
(Identity::Unary(o1), Identity::Unary(f1)) => {
Expr::tbl(Rc::clone(&from_tbl), o1).equals(Rc::clone(&to_tbl), f1)
}
(Identity::Binary(o1, o2), Identity::Binary(f1, f2)) => {
Expr::tbl(Rc::clone(&from_tbl), o1).equals(Rc::clone(&to_tbl), f1).and(
Expr::tbl(Rc::clone(&from_tbl), o2).equals(Rc::clone(&to_tbl), f2)
)
}
(Identity::Binary(o1, o2), Identity::Binary(f1, f2)) => Expr::tbl(Rc::clone(&from_tbl), o1)
.equals(Rc::clone(&to_tbl), f1)
.and(Expr::tbl(Rc::clone(&from_tbl), o2).equals(Rc::clone(&to_tbl), f2)),
_ => panic!("Owner key and foreign key mismatch"),
}
}