Skip to content

Commit 71f6072

Browse files
committed
Remove another clone, fix clippy
1 parent 67ab1c3 commit 71f6072

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

core/mvcc/cursor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl<Clock: LogicalClock + 'static> MvccLazyCursor<Clock> {
368368
MvccCursorType::Table => None,
369369
};
370370
self.db
371-
.read_from_table_or_index(self.tx_id, &row_id, maybe_index_id)
371+
.read_from_table_or_index(self.tx_id, row_id, maybe_index_id)
372372
}
373373

374374
pub fn close(self) -> Result<()> {
@@ -1485,7 +1485,7 @@ impl<Clock: LogicalClock + 'static> CursorTrait for MvccLazyCursor<Clock> {
14851485

14861486
fn count(&mut self) -> Result<IOResult<usize>> {
14871487
loop {
1488-
let state = self.count_state.clone();
1488+
let state = self.count_state;
14891489
match state {
14901490
None => {
14911491
self.count_state.replace(CountState::Rewind);

core/mvcc/database/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,8 @@ impl Transaction {
482482
}
483483
}
484484

485-
fn insert_to_read_set(&self, id: &RowID) {
486-
self.read_set.insert(id.clone());
485+
fn insert_to_read_set(&self, id: RowID) {
486+
self.read_set.insert(id);
487487
}
488488

489489
fn insert_to_write_set(&self, id: RowID) {
@@ -2630,7 +2630,7 @@ impl<Clock: LogicalClock> MvStore<Clock> {
26302630
.rev()
26312631
.find(|rv| rv.is_visible_to(tx, &self.txs))
26322632
{
2633-
tx.insert_to_read_set(id);
2633+
tx.insert_to_read_set(id.clone());
26342634
return Ok(Some(rv.row.clone()));
26352635
}
26362636
}

core/mvcc/database/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ fn test_delete_nonexistent() {
19401940
.mvcc_store
19411941
.delete(
19421942
tx,
1943-
&RowID {
1943+
RowID {
19441944
table_id: (-2).into(),
19451945
row_id: RowKey::Int(1)
19461946
},
@@ -2161,7 +2161,7 @@ fn test_dirty_read_deleted() {
21612161
.mvcc_store
21622162
.delete(
21632163
tx2,
2164-
&RowID {
2164+
RowID {
21652165
table_id: (-2).into(),
21662166
row_id: RowKey::Int(1)
21672167
},

core/mvcc/persistent_storage/logical_log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,7 @@ mod tests {
15801580
let mvcc_store = db.get_mvcc_store();
15811581
for (rowid, value) in &values {
15821582
let tx = mvcc_store.begin_tx(pager.clone()).unwrap();
1583-
let row = mvcc_store.read(tx, &rowid).unwrap().unwrap();
1583+
let row = mvcc_store.read(tx, rowid).unwrap().unwrap();
15841584
let record = ImmutableRecord::from_bin_record(row.payload().to_vec());
15851585
let foo = record.iter().unwrap().next().unwrap().unwrap();
15861586
let ValueRef::Text(foo) = foo else {

0 commit comments

Comments
 (0)