cargo fmt

This commit is contained in:
Billy Chan 2021-09-30 11:19:26 +08:00
parent 088bfd01e7
commit b716c9ed57
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,6 @@
use crate::{
error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert, PrimaryKeyTrait,
Statement, TryFromU64,
error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert,
PrimaryKeyTrait, Statement, TryFromU64,
};
use sea_query::InsertStatement;
use std::{future::Future, marker::PhantomData};

View File

@ -276,7 +276,9 @@ pub trait QueryFilter: Sized {
/// struct Input {
/// name: Option<String>,
/// }
/// let input = Input { name: Some("cheese".to_owned()) };
/// let input = Input {
/// name: Some("cheese".to_owned()),
/// };
///
/// let mut conditions = Condition::all();
/// if let Some(name) = input.name {
@ -298,13 +300,14 @@ pub trait QueryFilter: Sized {
/// struct Input {
/// name: Option<String>,
/// }
/// let input = Input { name: Some("cheese".to_owned()) };
/// let input = Input {
/// name: Some("cheese".to_owned()),
/// };
///
/// assert_eq!(
/// cake::Entity::find()
/// .filter(
/// Condition::all()
/// .add_option(input.name.map(|n| cake::Column::Name.contains(&n)))
/// Condition::all().add_option(input.name.map(|n| cake::Column::Name.contains(&n)))
/// )
/// .build(DbBackend::MySql)
/// .to_string(),