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: increase MSRV to 1.66 #129

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ documentation = "https://docs.rs/merkletree"
keywords = ["merkle", "merkle-tree"]
categories = ["data-structures", "cryptography"]
edition = "2018"
rust-version = "1.63"
rust-version = "1.66"

[package.metadata.release]
pre-release-commit-message = "chore(release): release {{version}}"
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
blacklisted-names = [
disallowed-names = [
"unreadable_literal"
]
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.63.0
1.66.1
4 changes: 2 additions & 2 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ use std::hash::Hasher;

/// A hashable type.
///
/// Types implementing `Hashable` are able to be [`hash`]ed with an instance of
/// Types implementing `Hashable` are able to be [`Hashable::hash`]ed with an instance of
/// [`Hasher`].
///
/// ## Implementing `Hashable`
///
/// You can derive `Hashable` with `#[derive(Hashable)]` if all fields implement `Hashable`.
/// The resulting hash will be the combination of the values from calling
/// [`hash`] on each field.
/// [`Hashable::hash`] on each field.
///
/// ```text
/// #[macro_use]
Expand Down
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Merkle tree (MT) implemented as a full (power of 2) arity tree allocated as a vec
//! of statically sized hashes to give hashes more locality (although disk based backings
//! are supported, as a partial tree disk based backings). MT is specialized
//! to the extent of arity, hashing algorithm and hash item. [`Hashable`] trait is
//! to the extent of arity, hashing algorithm and hash item. [`crate::hash::Hashable`] trait is
//! compatible to the `std::hash::Hasher` and supports custom hash algorithms.
//! Implementation does not depend on any external crypto libraries, and tries
//! to be as performant as possible (CPU support only; GPU hashing currently unsupported).
Expand Down Expand Up @@ -34,11 +34,11 @@
//!
//! `Object : Hashable<H> -> Hasher + Algorithm <- Merkle Tree`
//!
//! Custom [`merkle::hash::Hashable`] trait allows implementations differ
//! from [`std::collection`] related hashes, different implementations for
//! Custom [`crate::hash::Hashable`] trait allows implementations differ
//! from [`std::collections`] related hashes, different implementations for
//! different hashing algorithms / schemas and conforms object-safety trait rules.
//!
//! [`Algorithm`] complements [`Hasher`] to be reusable and follows the idea
//! [`crate::hash::Algorithm`] complements [`std::hash::Hasher`] to be reusable and follows the idea
//! that the result hash is a mapping of the data stream.
//!
//! [`Algorithm.hash`] had to change its signature to be `&mut self` (`&self`) because
Expand All @@ -48,8 +48,8 @@
//! on finalization, or `Cell`-ing via unsafe.
//!
//! Turning back to having [`Algorithm.write(&mut self, &[u8])`] instead of
//! `write(T)` allows to relax [`Algorithm`] trait [`Hasher`] constraint, even tho
//! works together well still.
//! `write(T)` allows to relax [`crate::hash::Algorithm`] trait [`std::hash::Hasher`] constraint,
//! even tho works together well still.
//!
//! # Interface
//!
Expand Down Expand Up @@ -86,7 +86,7 @@ extern crate anyhow;
/// Hash infrastructure for items in Merkle tree.
pub mod hash;

/// Common implementations for [`Hashable`].
/// Common implementations for [`crate::hash::Hashable`].
mod hash_impl;

/// Store implementations.
Expand Down
4 changes: 2 additions & 2 deletions src/store/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<E: Element> Store<E> for DiskStore<E> {

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

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

let file = File::open(&data_path)?;
let file = File::open(data_path)?;
let metadata = file.metadata()?;
let store_size = metadata.len() as usize;

Expand Down