cargo fmt
This commit is contained in:
parent
091a91fc0a
commit
fff738a706
@ -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
|
||||
|
@ -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(())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user