Skip to content

Commit f1e8b34

Browse files
committed
Address type-length limit in raw example
Signed-off-by: Nick Cameron <nrc@ncameron.org>
1 parent cfa5f8e commit f1e8b34

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

examples/raw.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
22

33
#![feature(async_await, await_macro)]
4+
#![type_length_limit = "3081103"]
45

56
mod common;
67

@@ -62,23 +63,22 @@ async fn main() -> Result<()> {
6263
.expect("Could not get just deleted entry");
6364
assert!(value.is_none());
6465

65-
// FIXME: batch commands seem to be broken due to over-large types.
6666
// You can ask to write multiple key-values at the same time, it is much more
6767
// performant because it is passed in one request to the key-value store.
68-
// let pairs = vec![
69-
// KvPair::from(("k1", "v1")),
70-
// KvPair::from(("k2", "v2")),
71-
// KvPair::from(("k3", "v3")),
72-
// ];
73-
// client.batch_put(pairs).await.expect("Could not put pairs");
68+
let pairs = vec![
69+
KvPair::from(("k1", "v1")),
70+
KvPair::from(("k2", "v2")),
71+
KvPair::from(("k3", "v3")),
72+
];
73+
client.batch_put(pairs).await.expect("Could not put pairs");
7474

7575
// Same thing when you want to retrieve multiple values.
76-
// let keys = vec![Key::from("k1"), Key::from("k2")];
77-
// let values = client
78-
// .batch_get(keys.clone())
79-
// .await
80-
// .expect("Could not get values");
81-
// println!("Found values: {:?} for keys: {:?}", values, keys);
76+
let keys = vec![Key::from("k1"), Key::from("k2")];
77+
let values = client
78+
.batch_get(keys.clone())
79+
.await
80+
.expect("Could not get values");
81+
println!("Found values: {:?} for keys: {:?}", values, keys);
8282

8383
// Scanning a range of keys is also possible giving it two bounds
8484
// it will returns all entries between these two.

0 commit comments

Comments
 (0)