Skip to content

Commit 579e097

Browse files
committed
chore: fix readme example
1 parent 877c2d2 commit 579e097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,15 @@ async fn service(messages: Vec<String>) -> Result<(), anyhow::Error> {
9090
### Batch insert rows and return them
9191

9292
```rust
93-
use batched::batched;
93+
use batched::{batched, error::SharedError};
9494

9595
struct Row {
9696
pub id: usize,
9797
pub content: String,
9898
}
9999

100100
#[batched(window = 100, limit = 100_000)]
101-
async fn insert_message_batched(messages: Vec<String>) -> Vec<Row> {
101+
async fn insert_message_batched(messages: Vec<String>) -> Result<Vec<Row>, SharedError<anyhow::Error>> {
102102
let pool = PgPool::connect("postgres://user:password@localhost/dbname").await?;
103103
let mut query = String::from("INSERT INTO messages (content) VALUES ");
104104
...

0 commit comments

Comments
 (0)