Fix clippy
This commit is contained in:
parent
f2dfbab3a0
commit
ef861294e2
@ -23,7 +23,7 @@ use select::*;
|
||||
|
||||
#[async_std::main]
|
||||
async fn main() {
|
||||
let db = Database::connect("sql://sea:sea@localhost/bakery")
|
||||
let db = Database::connect("mysql://sea:sea@localhost/test")
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@ -32,8 +32,4 @@ async fn main() {
|
||||
println!("===== =====\n");
|
||||
|
||||
all_about_select(&db).await.unwrap();
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
all_about_operation(&db).await.unwrap();
|
||||
}
|
||||
|
@ -2,46 +2,8 @@ use super::*;
|
||||
use sea_orm::{entity::*, error::*, query::*, DbConn, FromQueryResult};
|
||||
|
||||
pub async fn all_about_select(db: &DbConn) -> Result<(), DbErr> {
|
||||
find_all(db).await?;
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_one(db).await?;
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_one_to_one(db).await?;
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_one_to_many(db).await?;
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
count_fruits_by_cake(db).await?;
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_many_to_many(db).await?;
|
||||
|
||||
if false {
|
||||
println!("===== =====\n");
|
||||
|
||||
all_about_select_json(db).await?;
|
||||
}
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_all_stream(db).await.unwrap();
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_first_page(db).await.unwrap();
|
||||
|
||||
println!("===== =====\n");
|
||||
|
||||
find_num_pages(db).await.unwrap();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
@ -1054,10 +1054,8 @@ where
|
||||
} else {
|
||||
acc.insert(key, vec![value]);
|
||||
}
|
||||
} else {
|
||||
if acc.get(&key).is_none() {
|
||||
acc.insert(key, vec![]);
|
||||
}
|
||||
} else if acc.get(&key).is_none() {
|
||||
acc.insert(key, vec![]);
|
||||
}
|
||||
|
||||
acc
|
||||
|
Loading…
x
Reference in New Issue
Block a user