Skip to content

Commit c26f9d5

Browse files
authored
Merge pull request #169 from aerospike/fix-warnings-and-errors
Bring sources into rustc 1.90.x compliance.
2 parents 4a7a5d8 + 46d7057 commit c26f9d5

File tree

6 files changed

+53
-53
lines changed

6 files changed

+53
-53
lines changed

src/batch/batch_executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<T> SharedSlice<T> {
138138
}
139139

140140
pub fn get(&self, idx: usize) -> Option<&T> {
141-
unsafe { (*self.value.get()).get(idx) }
141+
unsafe { (&(*self.value.get())).get(idx) }
142142
}
143143

144144
// Like slice.get_mut but does not require a mutable reference!

src/operations/bitwise.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ pub fn set_int<'a>(
638638
/// bitSize = 5
639639
/// returns [0b1000000]
640640
/// ```
641-
pub fn get(bin: &str, bit_offset: i64, bit_size: i64) -> Operation {
641+
pub fn get(bin: &str, bit_offset: i64, bit_size: i64) -> Operation<'_> {
642642
let cdt_op = CdtOperation {
643643
op: CdtBitwiseOpType::Get as u8,
644644
encoder: Box::new(pack_cdt_bit_op),
@@ -663,7 +663,7 @@ pub fn get(bin: &str, bit_offset: i64, bit_size: i64) -> Operation {
663663
/// bitSize = 4
664664
/// returns 2
665665
/// ```
666-
pub fn count(bin: &str, bit_offset: i64, bit_size: i64) -> Operation {
666+
pub fn count(bin: &str, bit_offset: i64, bit_size: i64) -> Operation<'_> {
667667
let cdt_op = CdtOperation {
668668
op: CdtBitwiseOpType::Count as u8,
669669
encoder: Box::new(pack_cdt_bit_op),
@@ -690,7 +690,7 @@ pub fn count(bin: &str, bit_offset: i64, bit_size: i64) -> Operation {
690690
/// value = true
691691
/// returns 5
692692
/// ```
693-
pub fn lscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operation {
693+
pub fn lscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operation<'_> {
694694
let cdt_op = CdtOperation {
695695
op: CdtBitwiseOpType::LScan as u8,
696696
encoder: Box::new(pack_cdt_bit_op),
@@ -721,7 +721,7 @@ pub fn lscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operatio
721721
/// value = true
722722
/// returns 7
723723
/// ```
724-
pub fn rscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operation {
724+
pub fn rscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operation<'_> {
725725
let cdt_op = CdtOperation {
726726
op: CdtBitwiseOpType::RScan as u8,
727727
encoder: Box::new(pack_cdt_bit_op),
@@ -752,7 +752,7 @@ pub fn rscan(bin: &str, bit_offset: i64, bit_size: i64, value: bool) -> Operatio
752752
/// signed = false
753753
/// returns 16899
754754
/// ```
755-
pub fn get_int(bin: &str, bit_offset: i64, bit_size: i64, signed: bool) -> Operation {
755+
pub fn get_int(bin: &str, bit_offset: i64, bit_size: i64, signed: bool) -> Operation<'_> {
756756
let mut args = vec![CdtArgument::Int(bit_offset), CdtArgument::Int(bit_size)];
757757
if signed {
758758
args.push(CdtArgument::Byte(1));

src/operations/hll.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub fn set_union<'a>(policy: &HLLPolicy, bin: &'a str, list: &'a [Value]) -> Ope
180180

181181
/// Create HLL refresh operation.
182182
/// Server updates the cached count (if stale) and returns the count.
183-
pub fn refresh_count(bin: &str) -> Operation {
183+
pub fn refresh_count(bin: &str) -> Operation<'_> {
184184
let cdt_op = CdtOperation {
185185
op: HLLOpType::SetCount as u8,
186186
encoder: Box::new(pack_hll_op),
@@ -198,7 +198,7 @@ pub fn refresh_count(bin: &str) -> Operation {
198198
/// Servers folds `indexBitCount` to the specified value.
199199
/// This can only be applied when `minHashBitCount` on the HLL bin is 0.
200200
/// Server does not return a value.
201-
pub fn fold(bin: &str, index_bit_count: i64) -> Operation {
201+
pub fn fold(bin: &str, index_bit_count: i64) -> Operation<'_> {
202202
let cdt_op = CdtOperation {
203203
op: HLLOpType::Fold as u8,
204204
encoder: Box::new(pack_hll_op),
@@ -214,7 +214,7 @@ pub fn fold(bin: &str, index_bit_count: i64) -> Operation {
214214

215215
/// Create HLL getCount operation.
216216
/// Server returns estimated number of elements in the HLL bin.
217-
pub fn get_count(bin: &str) -> Operation {
217+
pub fn get_count(bin: &str) -> Operation<'_> {
218218
let cdt_op = CdtOperation {
219219
op: HLLOpType::Count as u8,
220220
encoder: Box::new(pack_hll_op),
@@ -298,7 +298,7 @@ pub fn get_similarity<'a>(bin: &'a str, list: &'a [Value]) -> Operation<'a> {
298298
/// Create HLL describe operation.
299299
/// Server returns `indexBitCount` and `minHashBitCount` used to create HLL bin in a list of longs.
300300
/// The list size is 2.
301-
pub fn describe(bin: &str) -> Operation {
301+
pub fn describe(bin: &str) -> Operation<'_> {
302302
let cdt_op = CdtOperation {
303303
op: HLLOpType::Describe as u8,
304304
encoder: Box::new(pack_hll_op),

src/operations/lists.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub const fn list_order_flag(order: ListOrderType, pad: bool) -> u8 {
189189
/// Server creates list at given context level. The context is allowed to be beyond list
190190
/// boundaries only if pad is set to true. In that case, nil list entries will be inserted to
191191
/// satisfy the context position.
192-
pub fn create(bin: &str, list_order: ListOrderType, pad: bool) -> Operation {
192+
pub fn create(bin: &str, list_order: ListOrderType, pad: bool) -> Operation<'_> {
193193
let cdt_op = CdtOperation {
194194
op: CdtListOpType::SetType as u8,
195195
encoder: Box::new(pack_cdt_op),
@@ -321,7 +321,7 @@ pub fn insert_items<'a>(
321321

322322
/// Create list pop operation. Server returns the item at the specified index and removes the
323323
/// item from the list bin.
324-
pub fn pop(bin: &str, index: i64) -> Operation {
324+
pub fn pop(bin: &str, index: i64) -> Operation<'_> {
325325
let cdt_op = CdtOperation {
326326
op: CdtListOpType::Pop as u8,
327327
encoder: Box::new(pack_cdt_op),
@@ -337,7 +337,7 @@ pub fn pop(bin: &str, index: i64) -> Operation {
337337

338338
/// Create list pop range operation. Server returns `count` items starting at the specified
339339
/// index and removes the items from the list bin.
340-
pub fn pop_range(bin: &str, index: i64, count: i64) -> Operation {
340+
pub fn pop_range(bin: &str, index: i64, count: i64) -> Operation<'_> {
341341
let cdt_op = CdtOperation {
342342
op: CdtListOpType::PopRange as u8,
343343
encoder: Box::new(pack_cdt_op),
@@ -353,7 +353,7 @@ pub fn pop_range(bin: &str, index: i64, count: i64) -> Operation {
353353

354354
/// Create list pop range operation. Server returns the items starting at the specified index
355355
/// to the end of the list and removes those items from the list bin.
356-
pub fn pop_range_from(bin: &str, index: i64) -> Operation {
356+
pub fn pop_range_from(bin: &str, index: i64) -> Operation<'_> {
357357
let cdt_op = CdtOperation {
358358
op: CdtListOpType::PopRange as u8,
359359
encoder: Box::new(pack_cdt_op),
@@ -369,7 +369,7 @@ pub fn pop_range_from(bin: &str, index: i64) -> Operation {
369369

370370
/// Create list remove operation. Server removes the item at the specified index from the list
371371
/// bin. Server returns the number of items removed.
372-
pub fn remove(bin: &str, index: i64) -> Operation {
372+
pub fn remove(bin: &str, index: i64) -> Operation<'_> {
373373
let cdt_op = CdtOperation {
374374
op: CdtListOpType::Remove as u8,
375375
encoder: Box::new(pack_cdt_op),
@@ -385,7 +385,7 @@ pub fn remove(bin: &str, index: i64) -> Operation {
385385

386386
/// Create list remove range operation. Server removes `count` items starting at the specified
387387
/// index from the list bin. Server returns the number of items removed.
388-
pub fn remove_range(bin: &str, index: i64, count: i64) -> Operation {
388+
pub fn remove_range(bin: &str, index: i64, count: i64) -> Operation<'_> {
389389
let cdt_op = CdtOperation {
390390
op: CdtListOpType::RemoveRange as u8,
391391
encoder: Box::new(pack_cdt_op),
@@ -401,7 +401,7 @@ pub fn remove_range(bin: &str, index: i64, count: i64) -> Operation {
401401

402402
/// Create list remove range operation. Server removes the items starting at the specified
403403
/// index to the end of the list. Server returns the number of items removed.
404-
pub fn remove_range_from(bin: &str, index: i64) -> Operation {
404+
pub fn remove_range_from(bin: &str, index: i64) -> Operation<'_> {
405405
let cdt_op = CdtOperation {
406406
op: CdtListOpType::RemoveRange as u8,
407407
encoder: Box::new(pack_cdt_op),
@@ -567,7 +567,7 @@ pub fn remove_by_value_relative_rank_range_count<'a>(
567567

568568
/// Creates a list remove operation.
569569
/// Server removes list item identified by index and returns removed data specified by returnType.
570-
pub fn remove_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Operation {
570+
pub fn remove_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Operation<'_> {
571571
let cdt_op = CdtOperation {
572572
op: CdtListOpType::RemoveByIndex as u8,
573573
encoder: Box::new(pack_cdt_op),
@@ -587,7 +587,7 @@ pub fn remove_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Op
587587
/// Creates a list remove operation.
588588
/// Server removes list items starting at specified index to the end of list and returns removed
589589
/// data specified by returnType.
590-
pub fn remove_by_index_range(bin: &str, index: i64, return_type: ListReturnType) -> Operation {
590+
pub fn remove_by_index_range(bin: &str, index: i64, return_type: ListReturnType) -> Operation<'_> {
591591
let cdt_op = CdtOperation {
592592
op: CdtListOpType::RemoveByIndexRange as u8,
593593
encoder: Box::new(pack_cdt_op),
@@ -611,7 +611,7 @@ pub fn remove_by_index_range_count(
611611
index: i64,
612612
count: i64,
613613
return_type: ListReturnType,
614-
) -> Operation {
614+
) -> Operation<'_> {
615615
let cdt_op = CdtOperation {
616616
op: CdtListOpType::RemoveByIndexRange as u8,
617617
encoder: Box::new(pack_cdt_op),
@@ -631,7 +631,7 @@ pub fn remove_by_index_range_count(
631631

632632
/// Creates a list remove operation.
633633
/// Server removes list item identified by rank and returns removed data specified by returnType.
634-
pub fn remove_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Operation {
634+
pub fn remove_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Operation<'_> {
635635
let cdt_op = CdtOperation {
636636
op: CdtListOpType::RemoveByRank as u8,
637637
encoder: Box::new(pack_cdt_op),
@@ -648,7 +648,7 @@ pub fn remove_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Oper
648648
/// Creates a list remove operation.
649649
/// Server removes list items starting at specified rank to the last ranked item and returns removed
650650
/// data specified by returnType.
651-
pub fn remove_by_rank_range(bin: &str, rank: i64, return_type: ListReturnType) -> Operation {
651+
pub fn remove_by_rank_range(bin: &str, rank: i64, return_type: ListReturnType) -> Operation<'_> {
652652
let cdt_op = CdtOperation {
653653
op: CdtListOpType::RemoveByRankRange as u8,
654654
encoder: Box::new(pack_cdt_op),
@@ -669,7 +669,7 @@ pub fn remove_by_rank_range_count(
669669
rank: i64,
670670
count: i64,
671671
return_type: ListReturnType,
672-
) -> Operation {
672+
) -> Operation<'_> {
673673
let cdt_op = CdtOperation {
674674
op: CdtListOpType::RemoveByRankRange as u8,
675675
encoder: Box::new(pack_cdt_op),
@@ -708,7 +708,7 @@ pub fn set<'a>(bin: &'a str, index: i64, value: &'a Value) -> Operation<'a> {
708708
/// Create list trim operation. Server removes `count` items in the list bin that do not fall
709709
/// into the range specified by `index` and `count`. If the range is out of bounds, then all
710710
/// items will be removed. Server returns list size after trim.
711-
pub fn trim(bin: &str, index: i64, count: i64) -> Operation {
711+
pub fn trim(bin: &str, index: i64, count: i64) -> Operation<'_> {
712712
let cdt_op = CdtOperation {
713713
op: CdtListOpType::Trim as u8,
714714
encoder: Box::new(pack_cdt_op),
@@ -724,7 +724,7 @@ pub fn trim(bin: &str, index: i64, count: i64) -> Operation {
724724

725725
/// Create list clear operation. Server removes all items in the list bin. Server does not
726726
/// return a result by default.
727-
pub fn clear(bin: &str) -> Operation {
727+
pub fn clear(bin: &str) -> Operation<'_> {
728728
let cdt_op = CdtOperation {
729729
op: CdtListOpType::Clear as u8,
730730
encoder: Box::new(pack_cdt_op),
@@ -759,7 +759,7 @@ pub fn increment<'a>(policy: &ListPolicy, bin: &'a str, index: i64, value: i64)
759759
}
760760

761761
/// Create list size operation. Server returns size of the list.
762-
pub fn size(bin: &str) -> Operation {
762+
pub fn size(bin: &str) -> Operation<'_> {
763763
let cdt_op = CdtOperation {
764764
op: CdtListOpType::Size as u8,
765765
encoder: Box::new(pack_cdt_op),
@@ -774,7 +774,7 @@ pub fn size(bin: &str) -> Operation {
774774
}
775775

776776
/// Create list get operation. Server returns the item at the specified index in the list bin.
777-
pub fn get(bin: &str, index: i64) -> Operation {
777+
pub fn get(bin: &str, index: i64) -> Operation<'_> {
778778
let cdt_op = CdtOperation {
779779
op: CdtListOpType::Get as u8,
780780
encoder: Box::new(pack_cdt_op),
@@ -790,7 +790,7 @@ pub fn get(bin: &str, index: i64) -> Operation {
790790

791791
/// Create list get range operation. Server returns `count` items starting at the specified
792792
/// index in the list bin.
793-
pub fn get_range(bin: &str, index: i64, count: i64) -> Operation {
793+
pub fn get_range(bin: &str, index: i64, count: i64) -> Operation<'_> {
794794
let cdt_op = CdtOperation {
795795
op: CdtListOpType::GetRange as u8,
796796
encoder: Box::new(pack_cdt_op),
@@ -806,7 +806,7 @@ pub fn get_range(bin: &str, index: i64, count: i64) -> Operation {
806806

807807
/// Create list get range operation. Server returns items starting at the index to the end of
808808
/// the list.
809-
pub fn get_range_from(bin: &str, index: i64) -> Operation {
809+
pub fn get_range_from(bin: &str, index: i64) -> Operation<'_> {
810810
let cdt_op = CdtOperation {
811811
op: CdtListOpType::GetRange as u8,
812812
encoder: Box::new(pack_cdt_op),
@@ -897,7 +897,7 @@ pub fn get_by_value_range<'a>(
897897

898898
/// Creates list get by index operation.
899899
/// Server selects list item identified by index and returns selected data specified by returnType
900-
pub fn get_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Operation {
900+
pub fn get_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Operation<'_> {
901901
let cdt_op = CdtOperation {
902902
op: CdtListOpType::GetByIndex as u8,
903903
encoder: Box::new(pack_cdt_op),
@@ -918,7 +918,7 @@ pub fn get_by_index(bin: &str, index: i64, return_type: ListReturnType) -> Opera
918918
/// Creates list get by index range operation.
919919
/// Server selects list items starting at specified index to the end of list and returns selected
920920
/// data specified by returnType.
921-
pub fn get_by_index_range(bin: &str, index: i64, return_type: ListReturnType) -> Operation {
921+
pub fn get_by_index_range(bin: &str, index: i64, return_type: ListReturnType) -> Operation<'_> {
922922
let cdt_op = CdtOperation {
923923
op: CdtListOpType::GetByIndexRange as u8,
924924
encoder: Box::new(pack_cdt_op),
@@ -944,7 +944,7 @@ pub fn get_by_index_range_count(
944944
index: i64,
945945
count: i64,
946946
return_type: ListReturnType,
947-
) -> Operation {
947+
) -> Operation<'_> {
948948
let cdt_op = CdtOperation {
949949
op: CdtListOpType::GetByIndexRange as u8,
950950
encoder: Box::new(pack_cdt_op),
@@ -965,7 +965,7 @@ pub fn get_by_index_range_count(
965965

966966
/// Creates a list get by rank operation.
967967
/// Server selects list item identified by rank and returns selected data specified by returnType.
968-
pub fn get_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Operation {
968+
pub fn get_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Operation<'_> {
969969
let cdt_op = CdtOperation {
970970
op: CdtListOpType::GetByRank as u8,
971971
encoder: Box::new(pack_cdt_op),
@@ -982,7 +982,7 @@ pub fn get_by_rank(bin: &str, rank: i64, return_type: ListReturnType) -> Operati
982982
/// Creates a list get by rank range operation.
983983
/// Server selects list items starting at specified rank to the last ranked item and returns selected
984984
/// data specified by returnType.
985-
pub fn get_by_rank_range(bin: &str, rank: i64, return_type: ListReturnType) -> Operation {
985+
pub fn get_by_rank_range(bin: &str, rank: i64, return_type: ListReturnType) -> Operation<'_> {
986986
let cdt_op = CdtOperation {
987987
op: CdtListOpType::GetByRankRange as u8,
988988
encoder: Box::new(pack_cdt_op),
@@ -1003,7 +1003,7 @@ pub fn get_by_rank_range_count(
10031003
rank: i64,
10041004
count: i64,
10051005
return_type: ListReturnType,
1006-
) -> Operation {
1006+
) -> Operation<'_> {
10071007
let cdt_op = CdtOperation {
10081008
op: CdtListOpType::GetByRankRange as u8,
10091009
encoder: Box::new(pack_cdt_op),
@@ -1100,7 +1100,7 @@ pub fn get_by_value_relative_rank_range_count<'a>(
11001100
/// Creates list sort operation.
11011101
/// Server sorts list according to sortFlags.
11021102
/// Server does not return a result by default.
1103-
pub fn sort(bin: &str, sort_flags: ListSortFlags) -> Operation {
1103+
pub fn sort(bin: &str, sort_flags: ListSortFlags) -> Operation<'_> {
11041104
let cdt_op = CdtOperation {
11051105
op: CdtListOpType::Sort as u8,
11061106
encoder: Box::new(pack_cdt_op),

0 commit comments

Comments
 (0)