Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation and example (close #59) #60

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update documentation and example (close #59)
naskya committed Jun 1, 2024
commit f71e22745a57743b84eb34caf163a15b6774ed17
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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]
7 changes: 5 additions & 2 deletions examples/simple_send.rs
Original file line number Diff line number Diff line change
@@ -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(())
}