cargo fmt

This commit is contained in:
Billy Chan 2022-06-21 11:12:28 +08:00
parent 091a91fc0a
commit fff738a706
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7
2 changed files with 3 additions and 14 deletions

View File

@ -298,11 +298,7 @@ pub async fn create_json_vec_table(db: &DbConn) -> Result<ExecResult, DbErr> {
.auto_increment()
.primary_key(),
)
.col(
ColumnDef::new(json_vec::Column::StrVec)
.string()
.not_null(),
)
.col(ColumnDef::new(json_vec::Column::StrVec).string().not_null())
.to_owned();
create_table(db, &create_table_stmt, JsonVec).await

View File

@ -22,11 +22,7 @@ async fn main() -> Result<(), DbErr> {
pub async fn insert_json_vec(db: &DatabaseConnection) -> Result<(), DbErr> {
let json_vec = json_vec::Model {
id: 1,
str_vec: json_vec::StringVec(vec![
"1".to_string(),
"2".to_string(),
"3".to_string(),
])
str_vec: json_vec::StringVec(vec!["1".to_string(), "2".to_string(), "3".to_string()]),
};
let result = json_vec.clone().into_active_model().insert(db).await?;
@ -38,10 +34,7 @@ pub async fn insert_json_vec(db: &DatabaseConnection) -> Result<(), DbErr> {
.one(db)
.await?;
assert_eq!(
model,
Some(json_vec)
);
assert_eq!(model, Some(json_vec));
Ok(())
}