From f71e22745a57743b84eb34caf163a15b6774ed17 Mon Sep 17 00:00:00 2001 From: naskya Date: Sun, 2 Jun 2024 07:53:44 +0900 Subject: [PATCH] Update documentation and example (close #59) --- README.md | 4 ++-- examples/simple_send.rs | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a61dd236..eb64b6eb 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ reference [this excellent document.](https://web.dev/notifications/) ## Requirements -Clients require an async executor. System Openssl is needed for compilation. +- Clients require an async executor. +- OpenSSL is required for compilation. You must install it on your host or use the `vendored` feature of the [openssl](https://docs.rs/openssl/) crate. ## Migration notes @@ -24,7 +25,6 @@ Example ```rust use web_push::*; -use web_push::clients::isahc_client::IsahcWebPushClient; use std::fs::File; #[tokio::main] diff --git a/examples/simple_send.rs b/examples/simple_send.rs index 3822e8c1..e51e3bdd 100644 --- a/examples/simple_send.rs +++ b/examples/simple_send.rs @@ -82,8 +82,11 @@ async fn main() -> Result<(), Box let client = IsahcWebPushClient::new()?; - let response = client.send(builder.build()?).await?; - println!("Sent: {:?}", response); + let result = client.send(builder.build()?).await; + + if let Err(error) = result { + println!("An error occured: {:?}", error); + } Ok(()) }