Skip to content

Commit 12485d9

Browse files
authored
fix: increase MSRV to 1.66 (#129)
`unicode-width` v0.1.14 uses the `mixed_integer_ops` feature which was stabilized in Rust version 1.66, hence also increase the MSRV of this repo. Also fix all Clippy and Rustdoc warnings.
1 parent f7baf4e commit 12485d9

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ documentation = "https://docs.rs/merkletree"
1616
keywords = ["merkle", "merkle-tree"]
1717
categories = ["data-structures", "cryptography"]
1818
edition = "2018"
19-
rust-version = "1.63"
19+
rust-version = "1.66"
2020

2121
[package.metadata.release]
2222
pre-release-commit-message = "chore(release): release {{version}}"

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
blacklisted-names = [
1+
disallowed-names = [
22
"unreadable_literal"
33
]

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.63.0
1+
1.66.1

src/hash.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use std::hash::Hasher;
44

55
/// A hashable type.
66
///
7-
/// Types implementing `Hashable` are able to be [`hash`]ed with an instance of
7+
/// Types implementing `Hashable` are able to be [`Hashable::hash`]ed with an instance of
88
/// [`Hasher`].
99
///
1010
/// ## Implementing `Hashable`
1111
///
1212
/// You can derive `Hashable` with `#[derive(Hashable)]` if all fields implement `Hashable`.
1313
/// The resulting hash will be the combination of the values from calling
14-
/// [`hash`] on each field.
14+
/// [`Hashable::hash`] on each field.
1515
///
1616
/// ```text
1717
/// #[macro_use]

src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Merkle tree (MT) implemented as a full (power of 2) arity tree allocated as a vec
44
//! of statically sized hashes to give hashes more locality (although disk based backings
55
//! are supported, as a partial tree disk based backings). MT is specialized
6-
//! to the extent of arity, hashing algorithm and hash item. [`Hashable`] trait is
6+
//! to the extent of arity, hashing algorithm and hash item. [`crate::hash::Hashable`] trait is
77
//! compatible to the `std::hash::Hasher` and supports custom hash algorithms.
88
//! Implementation does not depend on any external crypto libraries, and tries
99
//! to be as performant as possible (CPU support only; GPU hashing currently unsupported).
@@ -34,11 +34,11 @@
3434
//!
3535
//! `Object : Hashable<H> -> Hasher + Algorithm <- Merkle Tree`
3636
//!
37-
//! Custom [`merkle::hash::Hashable`] trait allows implementations differ
38-
//! from [`std::collection`] related hashes, different implementations for
37+
//! Custom [`crate::hash::Hashable`] trait allows implementations differ
38+
//! from [`std::collections`] related hashes, different implementations for
3939
//! different hashing algorithms / schemas and conforms object-safety trait rules.
4040
//!
41-
//! [`Algorithm`] complements [`Hasher`] to be reusable and follows the idea
41+
//! [`crate::hash::Algorithm`] complements [`std::hash::Hasher`] to be reusable and follows the idea
4242
//! that the result hash is a mapping of the data stream.
4343
//!
4444
//! [`Algorithm.hash`] had to change its signature to be `&mut self` (`&self`) because
@@ -48,8 +48,8 @@
4848
//! on finalization, or `Cell`-ing via unsafe.
4949
//!
5050
//! Turning back to having [`Algorithm.write(&mut self, &[u8])`] instead of
51-
//! `write(T)` allows to relax [`Algorithm`] trait [`Hasher`] constraint, even tho
52-
//! works together well still.
51+
//! `write(T)` allows to relax [`crate::hash::Algorithm`] trait [`std::hash::Hasher`] constraint,
52+
//! even tho works together well still.
5353
//!
5454
//! # Interface
5555
//!
@@ -86,7 +86,7 @@ extern crate anyhow;
8686
/// Hash infrastructure for items in Merkle tree.
8787
pub mod hash;
8888

89-
/// Common implementations for [`Hashable`].
89+
/// Common implementations for [`crate::hash::Hashable`].
9090
mod hash_impl;
9191

9292
/// Store implementations.

src/store/disk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl<E: Element> Store<E> for DiskStore<E> {
129129

130130
fn new_from_disk(size: usize, _branches: usize, config: &StoreConfig) -> Result<Self> {
131131
let data_path = StoreConfig::data_path(&config.path, &config.id);
132-
Self::new_from_disk_with_path(size, &data_path)
132+
Self::new_from_disk_with_path(size, data_path)
133133
}
134134

135135
fn write_at(&mut self, el: E, index: usize) -> Result<()> {
@@ -494,7 +494,7 @@ impl<E: Element> DiskStore<E> {
494494
) -> Result<bool> {
495495
let data_path = StoreConfig::data_path(&config.path, &config.id);
496496

497-
let file = File::open(&data_path)?;
497+
let file = File::open(data_path)?;
498498
let metadata = file.metadata()?;
499499
let store_size = metadata.len() as usize;
500500

0 commit comments

Comments
 (0)