Skip to content

Commit

Permalink
Update documentation and example (close #59) (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
naskya authored Jun 1, 2024
1 parent 40febe4 commit 463dd8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -24,7 +25,6 @@ Example

```rust
use web_push::*;
use web_push::clients::isahc_client::IsahcWebPushClient;
use std::fs::File;

#[tokio::main]
Expand Down
7 changes: 5 additions & 2 deletions examples/simple_send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>

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(())
}

0 comments on commit 463dd8f

Please sign in to comment.