Update client initialization in README (#503)

Signed-off-by: Benjamin Kane <92759008+bkane-msft@users.noreply.github.com>
This commit is contained in:
Benjamin Kane 2025-08-28 19:07:31 -07:00 committed by GitHub
parent 76959e7523
commit 691df4d95a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ Raw mode:
```rust
use tikv_client::RawClient;
let client = RawClient::new(vec!["127.0.0.1:2379"], None).await?;
let client = RawClient::new(vec!["127.0.0.1:2379"]).await?;
client.put("key".to_owned(), "value".to_owned()).await?;
let value = client.get("key".to_owned()).await?;
```
@ -43,7 +43,7 @@ Transactional mode:
```rust
use tikv_client::TransactionClient;
let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"], None).await?;
let txn_client = TransactionClient::new(vec!["127.0.0.1:2379"]).await?;
let mut txn = txn_client.begin_optimistic().await?;
txn.put("key".to_owned(), "value".to_owned()).await?;
let value = txn.get("key".to_owned()).await?;