Skip to content

Commit 3575db8

Browse files
committed
apollo_storage: rename standalone adjective variables
1 parent 5a229fc commit 3575db8

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

crates/apollo_storage/src/body/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,19 @@ impl<'env, Mode: TransactionKind> StorageTxn<'env, Mode> {
316316
return Ok(None);
317317
}
318318
let mut cursor = transaction_metadata_table.cursor(&self.txn)?;
319-
let mut current =
319+
let mut current_entry =
320320
cursor.lower_bound(&TransactionIndex(block_number, TransactionOffsetInBlock(0)))?;
321321

322322
// TODO(dvir): consider initializing with capacity based on the get_block_transactions_count
323323
// function.
324324
let mut res = Vec::new();
325-
while let Some((TransactionIndex(current_block_number, _), tx_metadata)) = current {
325+
while let Some((TransactionIndex(current_block_number, _), tx_metadata)) = current_entry {
326326
if current_block_number != block_number {
327327
break;
328328
}
329329
let tx_output = tx_metadata_to_tx_object(tx_metadata, &self.file_handlers)?;
330330
res.push(tx_output);
331-
current = cursor.next()?;
331+
current_entry = cursor.next()?;
332332
}
333333
Ok(Some(res))
334334
}

crates/apollo_storage/src/db/table_types/test_utils.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -234,41 +234,41 @@ fn table_cursor_test<T: TableType>(
234234

235235
// Test lower_bound().
236236
let mut cursor = table.cursor(&txn).unwrap();
237-
let current = cursor.lower_bound(&(0, 0)).unwrap();
238-
assert_eq!(current, Some(((1, 1), 7)));
239-
let current = cursor.lower_bound(&(2, 2)).unwrap();
240-
assert_eq!(current, Some(((2, 2), 2)));
241-
let current = cursor.lower_bound(&(2, 4)).unwrap();
242-
assert_eq!(current, Some(((3, 1), 8)));
243-
let current = cursor.lower_bound(&(4, 4)).unwrap();
244-
assert_eq!(current, None);
237+
let current_entry = cursor.lower_bound(&(0, 0)).unwrap();
238+
assert_eq!(current_entry, Some(((1, 1), 7)));
239+
let current_entry = cursor.lower_bound(&(2, 2)).unwrap();
240+
assert_eq!(current_entry, Some(((2, 2), 2)));
241+
let current_entry = cursor.lower_bound(&(2, 4)).unwrap();
242+
assert_eq!(current_entry, Some(((3, 1), 8)));
243+
let current_entry = cursor.lower_bound(&(4, 4)).unwrap();
244+
assert_eq!(current_entry, None);
245245

246246
// Iterate using next().
247247
let mut cursor = table.cursor(&txn).unwrap();
248-
let mut current = cursor.lower_bound(&(0, 0)).unwrap();
248+
let mut current_entry = cursor.lower_bound(&(0, 0)).unwrap();
249249
for kv_pair in SORTED_VALUES {
250-
assert_eq!(current, Some(kv_pair));
251-
current = cursor.next().unwrap();
250+
assert_eq!(current_entry, Some(kv_pair));
251+
current_entry = cursor.next().unwrap();
252252
}
253-
current = cursor.next().unwrap();
254-
assert_eq!(current, None);
253+
current_entry = cursor.next().unwrap();
254+
assert_eq!(current_entry, None);
255255
// In the end still return None.
256-
current = cursor.next().unwrap();
257-
assert_eq!(current, None);
256+
current_entry = cursor.next().unwrap();
257+
assert_eq!(current_entry, None);
258258

259259
// Iterate using prev().
260260
let mut cursor = table.cursor(&txn).unwrap();
261-
let mut current = cursor.lower_bound(&(4, 4)).unwrap();
262-
assert_eq!(current, None);
261+
let mut current_entry = cursor.lower_bound(&(4, 4)).unwrap();
262+
assert_eq!(current_entry, None);
263263
for kv_pair in SORTED_VALUES.iter().rev().cloned() {
264-
current = cursor.prev().unwrap();
265-
assert_eq!(current, Some(kv_pair));
264+
current_entry = cursor.prev().unwrap();
265+
assert_eq!(current_entry, Some(kv_pair));
266266
}
267-
current = cursor.prev().unwrap();
268-
assert_eq!(current, None);
267+
current_entry = cursor.prev().unwrap();
268+
assert_eq!(current_entry, None);
269269
// In the end still return None.
270-
current = cursor.prev().unwrap();
271-
assert_eq!(current, None);
270+
current_entry = cursor.prev().unwrap();
271+
assert_eq!(current_entry, None);
272272
}
273273

274274
// Constants for random_table_test.

0 commit comments

Comments
 (0)