Skip to content

Commit 953988c

Browse files
authored
fix deprecation and clippy warnings (#1042)
1 parent 603830f commit 953988c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

examples/tx_collisions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::{Context, Result};
22
use electrs_rocksdb::{ColumnFamilyDescriptor, IteratorMode, Options, DB};
33

44
fn main() -> Result<()> {
5-
let path = std::env::args().skip(1).next().context("missing DB path")?;
5+
let path = std::env::args().nth(1).context("missing DB path")?;
66
let cf_names = DB::list_cf(&Options::default(), &path)?;
77
let cfs: Vec<_> = cf_names
88
.iter()

src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ fn default_daemon_dir() -> PathBuf {
183183
fn default_config_files() -> Vec<OsString> {
184184
let mut files = vec![OsString::from("electrs.toml")]; // cwd
185185
if let Some(mut path) = home_dir() {
186-
path.extend(&[".electrs", "config.toml"]);
186+
path.extend([".electrs", "config.toml"]);
187187
files.push(OsString::from(path)) // home directory
188188
}
189189
files.push(OsString::from("/etc/electrs/config.toml")); // system-wide

src/mempool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl Serialize for FeeHistogram {
344344
let mut seq = serializer.serialize_seq(Some(self.vsize.len()))?;
345345
// https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-methods.html#mempool-get-fee-histogram
346346
let fee_rates =
347-
(0..FeeHistogram::BINS).map(|i| std::u64::MAX.checked_shr(i as u32).unwrap_or(0));
347+
(0..FeeHistogram::BINS).map(|i| u64::MAX.checked_shr(i as u32).unwrap_or(0));
348348
fee_rates
349349
.zip(self.vsize.iter().copied())
350350
.skip_while(|(_fee_rate, vsize)| *vsize == 0)

src/merkle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ mod tests {
108108
.join(block_hash_hex);
109109
let data = std::fs::read(path).unwrap();
110110
let block: Block = deserialize(&data).unwrap();
111-
block.txdata.iter().map(|tx| tx.txid()).collect()
111+
block.txdata.iter().map(|tx| tx.compute_txid()).collect()
112112
}
113113
}

0 commit comments

Comments
 (0)