Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few clippy warnings #1097

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ pub struct Config {
pub network: Network,
pub db_path: PathBuf,
pub db_log_dir: Option<PathBuf>,
pub daemon_dir: PathBuf,
pub daemon_auth: SensitiveAuth,
pub daemon_rpc_addr: SocketAddr,
pub daemon_p2p_addr: SocketAddr,
Expand Down Expand Up @@ -350,7 +349,6 @@ impl Config {
network: config.network,
db_path: config.db_dir,
db_log_dir: config.db_log_dir,
daemon_dir: config.daemon_dir,
daemon_auth,
daemon_rpc_addr,
daemon_p2p_addr,
Expand Down
6 changes: 3 additions & 3 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ impl DBStore {
self.iter_prefix_cf(self.txid_cf(), prefix)
}

fn iter_cf<'a, const N: usize>(
&'a self,
fn iter_cf<const N: usize>(
&self,
cf: &rocksdb::ColumnFamily,
readopts: rocksdb::ReadOptions,
prefix: Option<HashPrefix>,
Expand Down Expand Up @@ -385,7 +385,7 @@ impl<'a, const N: usize> DBIterator<'a, N> {
}
}

impl<'a, const N: usize> Iterator for DBIterator<'a, N> {
impl<const N: usize> Iterator for DBIterator<'_, N> {
type Item = [u8; N];

fn next(&mut self) -> Option<Self::Item> {
Expand Down
2 changes: 1 addition & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ fn index_single_block(
height: usize,
}

impl<'a> Visitor for IndexBlockVisitor<'a> {
impl Visitor for IndexBlockVisitor<'_> {
fn visit_transaction(&mut self, tx: &bsl::Transaction) -> ControlFlow<()> {
let txid = bsl_txid(tx);
self.batch
Expand Down
6 changes: 3 additions & 3 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl ScriptHashStatus {
fn confirmed_height_entries<'a>(
&'a self,
chain: &'a Chain,
) -> impl Iterator<Item = (usize, &[TxEntry])> + 'a {
) -> impl Iterator<Item = (usize, &'a [TxEntry])> + 'a {
self.confirmed
.iter()
.filter_map(move |(blockhash, entries)| {
Expand All @@ -252,7 +252,7 @@ impl ScriptHashStatus {

/// Iterate through confirmed TxEntries.
/// Skip entries from stale blocks.
fn confirmed_entries<'a>(&'a self, chain: &'a Chain) -> impl Iterator<Item = &TxEntry> + 'a {
fn confirmed_entries<'a>(&'a self, chain: &'a Chain) -> impl Iterator<Item = &'a TxEntry> + 'a {
self.confirmed_height_entries(chain)
.flat_map(|(_height, entries)| entries)
}
Expand Down Expand Up @@ -565,7 +565,7 @@ fn filter_block_txs_inputs(
pos: usize,
}

impl<'a> Visitor for FindInputs<'a> {
impl Visitor for FindInputs<'_> {
fn visit_transaction(&mut self, tx: &bsl::Transaction) -> ControlFlow<()> {
if !self.buffer.is_empty() {
let result = std::mem::take(&mut self.buffer);
Expand Down
Loading