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::{ use crate::{
error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert, PrimaryKeyTrait, error::*, ActiveModelTrait, DatabaseConnection, DbBackend, EntityTrait, Insert,
Statement, TryFromU64, PrimaryKeyTrait, Statement, TryFromU64,
}; };
use sea_query::InsertStatement; use sea_query::InsertStatement;
use std::{future::Future, marker::PhantomData}; use std::{future::Future, marker::PhantomData};

View File

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