Skip to content

Commit 030ad4e

Browse files
committed
merged with 5.6 expressions
1 parent 36f1881 commit 030ad4e

File tree

24 files changed

+132
-80
lines changed

24 files changed

+132
-80
lines changed

aerospike-core/src/commands/buffer.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,11 +492,8 @@ impl Buffer {
492492
OperationType::Read
493493
| OperationType::CdtRead
494494
| OperationType::BitRead
495-
| OperationType::HllRead,
496-
..
497-
}
498-
| Operation {
499-
op: OperationType::ExpRead,
495+
| OperationType::HllRead
496+
| OperationType::ExpRead,
500497
..
501498
} => read_attr |= INFO1_READ,
502499
_ => write_attr |= INFO2_WRITE,

aerospike-core/src/operations/cdt_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
//! Operation Context for nested Operations
1616
use crate::operations::lists::{list_order_flag, ListOrderType};
17+
use crate::operations::maps::map_order_flag;
1718
use crate::operations::MapOrder;
1819
use crate::Value;
19-
use crate::operations::maps::map_order_flag;
2020

2121
#[doc(hidden)]
2222
// Empty Context for scalar operations

src/operations/exp.rs renamed to aerospike-core/src/operations/exp.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ pub enum ExpWriteFlags {
4545
}
4646

4747
#[doc(hidden)]
48-
pub type ExpressionEncoder = Box<dyn Fn(&mut Option<&mut Buffer>, &ExpOperation) -> Result<usize>>;
48+
pub type ExpressionEncoder =
49+
Box<dyn Fn(&mut Option<&mut Buffer>, &ExpOperation) -> Result<usize> + Send + Sync + 'static>;
4950

5051
#[doc(hidden)]
5152
pub struct ExpOperation<'a> {

aerospike-core/src/operations/maps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ pub const fn map_order_flag(order: MapOrder) -> u8 {
231231
match order {
232232
MapOrder::KeyOrdered => 0x80,
233233
MapOrder::Unordered => 0x40,
234-
MapOrder::KeyValueOrdered => 0xc0
234+
MapOrder::KeyValueOrdered => 0xc0,
235235
}
236236
}
237237

tests/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ async fn node_names() {
3535
let client = common::client().await;
3636
let names = client.node_names().await;
3737
assert!(!names.is_empty());
38-
client.close().await;
38+
client.close().await.unwrap();
3939
}
4040

4141
#[aerospike_macro::test]
4242
async fn nodes() {
4343
let client = common::client().await;
4444
let nodes = client.nodes().await;
4545
assert!(!nodes.is_empty());
46-
client.close().await;
46+
client.close().await.unwrap();
4747
}
4848

4949
#[aerospike_macro::test]
@@ -53,7 +53,7 @@ async fn get_node() {
5353
let node = client.get_node(&name).await;
5454
assert!(node.is_ok());
5555
}
56-
client.close().await;
56+
client.close().await.unwrap();
5757
}
5858

5959
#[aerospike_macro::test]

tests/src/batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ async fn batch_get() {
7979
assert_eq!(result.key, key4);
8080
let record = result.record;
8181
assert!(record.is_none());
82-
client.close().await;
82+
client.close().await.unwrap();
8383
}

tests/src/cdt_bitwise.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,5 @@ async fn cdt_bitwise() {
189189
let ops = &vec![bitwise::rscan("bin", 19, 8, true)];
190190
let rec = client.operate(&wpolicy, &key, ops).await.unwrap();
191191
assert_eq!(*rec.bins.get("bin").unwrap(), Value::Int(7));
192-
client.close().await;
192+
client.close().await.unwrap();
193193
}

tests/src/cdt_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,5 +448,5 @@ fn cdt_list() {
448448
)];
449449
let rec = client.operate(&wpolicy, &key, ops).await.unwrap();
450450
assert_eq!(*rec.bins.get("bin").unwrap(), as_list!(8, 9));
451-
client.close().await;
451+
client.close().await.unwrap();
452452
}

tests/src/cdt_map.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,16 @@ async fn map_operations() {
306306
let xkey = as_val!("y");
307307
let xval = as_val!(8);
308308
let op = [maps::put(&mpolicy, bin_name, &xkey, &xval).set_context(ctx)];
309-
client.operate(&wpolicy, &key, &op).unwrap();
309+
client.operate(&wpolicy, &key, &op).await.unwrap();
310310
let op = [maps::get_by_key(bin_name, &xkey, MapReturnType::Value).set_context(ctx)];
311-
let rec = client.operate(&wpolicy, &key, &op).unwrap();
311+
let rec = client.operate(&wpolicy, &key, &op).await.unwrap();
312312
assert_eq!(*rec.bins.get(bin_name).unwrap(), as_val!(8));
313313

314314
let mkey2 = as_val!("ctxtest3");
315-
let ctx = &vec![ctx_map_key(mkey), ctx_map_key_create(mkey2, MapOrder::Unordered)];
315+
let ctx = &vec![
316+
ctx_map_key(mkey),
317+
ctx_map_key_create(mkey2, MapOrder::Unordered),
318+
];
316319
let xkey = as_val!("c");
317320
let xval = as_val!(9);
318321
let op = [maps::put(&mpolicy, bin_name, &xkey, &xval).set_context(ctx)];
@@ -321,5 +324,5 @@ async fn map_operations() {
321324
let rec = client.operate(&wpolicy, &key, &op).await.unwrap();
322325
assert_eq!(*rec.bins.get(bin_name).unwrap(), as_val!(9));
323326

324-
client.close().await;
327+
client.close().await.unwrap();
325328
}

0 commit comments

Comments
 (0)