Skip to content

Commit

Permalink
chore: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
arriqaaq committed Jan 6, 2025
1 parent 2df1c73 commit b8c8d4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ impl Snapshot {
{
self.snap
.scan_at_ts(range, ts)
.into_iter()
.filter(|(_, snap_val)| !snap_val.deleted())
.collect()
}
Expand Down Expand Up @@ -206,7 +205,7 @@ mod tests {
keys_values.len(),
"Should match the number of keys"
);
let expected = vec![
let expected = [
(Box::from(&b"k1"[..]), Box::from(&b"value1Updated"[..])),
(Box::from(&b"k2"[..]), Box::from(&b"value2Updated"[..])),
];
Expand Down
10 changes: 8 additions & 2 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ pub type ScanResult = (Box<[u8]>, Box<[u8]>, u64);
/// ScanResult is a tuple containing the key, value, timestamp, and info about whether the key is deleted.
pub type ScanVersionResult = (Box<[u8]>, Box<[u8]>, u64, bool);

// For scan_at_ts return type
type ScanTsResult = Vec<(Box<[u8]>, Box<[u8]>)>;

// For get_value_by_query return type
type QueryResult = Option<(Box<[u8]>, u64, u64)>;

#[derive(Default, Debug, Copy, Clone)]
pub enum Durability {
/// Commits with this durability level are guaranteed to be persistent eventually. The data
Expand Down Expand Up @@ -780,7 +786,7 @@ impl Transaction {
range: R,
ts: u64,
limit: Option<usize>,
) -> Result<Vec<(Box<[u8]>, Box<[u8]>)>>
) -> Result<ScanTsResult>
where
R: RangeBounds<&'b [u8]>,
{
Expand Down Expand Up @@ -828,7 +834,7 @@ impl Transaction {
&self,
key: &VariableSizeKey,
query_type: QueryType,
) -> Result<Option<(Box<[u8]>, u64, u64)>> {
) -> Result<QueryResult> {
self.ensure_read_only_transaction()?;

match self
Expand Down

0 comments on commit b8c8d4c

Please sign in to comment.