Fix readme example

There was `serde_json::Error`
This commit is contained in:
Imbolc 2022-07-05 12:16:24 +03:00 committed by GitHub
parent bca15c561c
commit 6cc5750fe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,7 @@ async fn example_job(
message: &'static str,
) -> sqlx::Result<()> {
// Decode a JSON payload
let who: Option<String> = current_job.json()?;
let who: Option<String> = current_job.json().unwrap_or_default();
// Do some work
println!("{}, {}!", message, who.as_deref().unwrap_or("world"));