Fix clippy

This commit is contained in:
Chris Tsang 2023-08-04 20:26:12 +01:00
parent f2dfbab3a0
commit ef861294e2
3 changed files with 3 additions and 47 deletions

View File

@ -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();
}

View File

@ -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(())
}

View File

@ -1054,11 +1054,9 @@ where
} else {
acc.insert(key, vec![value]);
}
} else {
if acc.get(&key).is_none() {
} else if acc.get(&key).is_none() {
acc.insert(key, vec![]);
}
}
acc
});