Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Sep 30, 2021
1 parent 088bfd0 commit b716c9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/executor/insert.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
11 changes: 7 additions & 4 deletions src/query/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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(),
Expand Down

0 comments on commit b716c9e

Please sign in to comment.