Put stuct first since it's easier that way for the walk through.
This commit is contained in:
parent
e97968054d
commit
b467f77a79
14
src/main.rs
14
src/main.rs
|
|
@ -1,6 +1,13 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{types::Json, Row};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct Doc {
|
||||
age: u32,
|
||||
fav_color: String,
|
||||
fav_movie: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
// Connect to the database.
|
||||
|
|
@ -61,10 +68,3 @@ async fn main() -> anyhow::Result<()> {
|
|||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
struct Doc {
|
||||
age: u32,
|
||||
fav_color: String,
|
||||
fav_movie: String,
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue