Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
AbnerZheng committed Jun 11, 2024
1 parent 76d7141 commit 3f45a3c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 29 deletions.
1 change: 0 additions & 1 deletion mini-lsm-starter/src/compact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::iterators::StorageIterator;
use crate::key::KeySlice;
use crate::lsm_storage::{CompactionFilter, LsmStorageInner, LsmStorageState};
use crate::manifest::ManifestRecord;
use crate::mvcc::watermark;
use crate::table::{SsTable, SsTableBuilder, SsTableIterator};

mod leveled;
Expand Down
3 changes: 1 addition & 2 deletions mini-lsm-starter/src/lsm_iterator.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use std::collections::Bound;

use anyhow::{bail, Result};
use log::warn;

use crate::iterators::concat_iterator::SstConcatIterator;
use crate::iterators::two_merge_iterator::TwoMergeIterator;
use crate::key::{KeyBytes, KeySlice};
use crate::key::KeyBytes;
use crate::table::SsTableIterator;
use crate::{
iterators::{merge_iterator::MergeIterator, StorageIterator},
Expand Down
2 changes: 0 additions & 2 deletions mini-lsm-starter/src/mvcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ use self::{txn::Transaction, watermark::Watermark};

pub(crate) struct CommittedTxnData {
pub(crate) key_hashes: HashSet<u32>,
#[allow(dead_code)]
pub(crate) read_ts: u64,
#[allow(dead_code)]
pub(crate) commit_ts: u64,
}

Expand Down
8 changes: 2 additions & 6 deletions mini-lsm-starter/src/mvcc/txn.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#![allow(unused_variables)] // TODO(you): remove this lint after implementing this mod
#![allow(dead_code)] // TODO(you): remove this lint after implementing this mod

use std::ops::Bound::{Excluded, Unbounded};
use std::ops::Bound::Excluded;
use std::sync::atomic::Ordering;
use std::{
collections::HashSet,
Expand All @@ -10,9 +7,8 @@ use std::{
};

use anyhow::Result;
use bytes::{Buf, Bytes};
use bytes::Bytes;
use crossbeam_skiplist::SkipMap;
use log::warn;
use ouroboros::self_referencing;
use parking_lot::Mutex;

Expand Down
26 changes: 13 additions & 13 deletions mini-lsm-starter/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
//! DO NOT MODIFY -- Mini-LSM tests modules
//! This file will be automatically rewritten by the copy-test command.
mod week1_day6;
mod harness;
mod week1_day1;
mod week1_day2;
mod week1_day3;
mod week1_day4;
mod week1_day5;
mod week1_day6;
mod week1_day7;
mod week2_day1;
mod week2_day2;
mod week3_day3;
mod week3_day7;
mod week2_day6;
mod week3_day6;
mod harness;
mod week2_day3;
mod week3_day2;
mod week3_day5;
mod week2_day4;
mod week2_day5;
mod week2_day6;
mod week3_day1;
mod week2_day1;
mod week3_day2;
mod week3_day3;
mod week3_day4;
mod week2_day5;
mod week1_day4;
mod week1_day5;
mod week1_day1;
mod week3_day5;
mod week3_day6;
mod week3_day7;
2 changes: 0 additions & 2 deletions mini-lsm-starter/src/tests/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ where
assert!(!iter.is_valid());
}

#[allow(dead_code)]
pub fn check_iter_result_by_key_and_ts<I>(iter: &mut I, expected: Vec<((Bytes, u64), Bytes)>)
where
I: for<'a> StorageIterator<KeyType<'a> = KeySlice<'a>>,
Expand Down Expand Up @@ -215,7 +214,6 @@ pub fn generate_sst(
builder.build(id, block_cache, path.as_ref()).unwrap()
}

#[allow(dead_code)]
pub fn generate_sst_with_ts(
id: usize,
path: impl AsRef<Path>,
Expand Down
1 change: 0 additions & 1 deletion mini-lsm-starter/src/tests/week2_day1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ fn test_task1_full_compaction() {
let dir = tempdir().unwrap();
let storage =
Arc::new(LsmStorageInner::open(&dir, LsmStorageOptions::default_for_week1_test()).unwrap());
#[allow(clippy::let_unit_value)]
let _txn = storage.new_txn().unwrap();
storage.put(b"0", b"v1").unwrap();
sync(&storage);
Expand Down
3 changes: 1 addition & 2 deletions mini-lsm-starter/src/tests/week3_day7.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use bytes::Bytes;
use tempfile::tempdir;

use crate::iterators::StorageIterator;
use crate::{
compact::CompactionOptions,
lsm_storage::{CompactionFilter, LsmStorageOptions, MiniLsm, WriteBatchRecord},
};

use super::harness::{as_bytes, check_iter_result_by_key, construct_merge_iterator_over_storage};
use super::harness::{check_iter_result_by_key, construct_merge_iterator_over_storage};

#[test]
fn test_task3_mvcc_compaction() {
Expand Down

0 comments on commit 3f45a3c

Please sign in to comment.