Skip to content

Bump digest to v0.11.0-pre.3; MSRV 1.71#523

Merged
tarcieri merged 6 commits intomasterfrom
digest/v0.11.0-pre
Jan 6, 2024
Merged

Bump digest to v0.11.0-pre.3; MSRV 1.71#523
tarcieri merged 6 commits intomasterfrom
digest/v0.11.0-pre

Conversation

@tarcieri
Copy link
Member

Also bumps crate editions to 2021 where appropriate

@tarcieri tarcieri changed the title [WIP] Bump digest to v0.11.0-pre; MSRV 1.65 Bump digest to v0.11.0-pre.1; MSRV 1.65 Jan 3, 2024
@tarcieri tarcieri marked this pull request as ready for review January 3, 2024 00:04
@tarcieri tarcieri requested a review from newpavlov January 3, 2024 00:04
@tarcieri tarcieri force-pushed the digest/v0.11.0-pre branch from 0c342cb to fbd933f Compare January 3, 2024 22:45
@tarcieri tarcieri changed the title Bump digest to v0.11.0-pre.1; MSRV 1.65 Bump digest to v0.11.0-pre.2; MSRV 1.65 Jan 3, 2024
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to update MSRV in a number of crate readmes.

// SAFETY: Array<u8, U64> and [u8; 64] have
// exactly the same memory layout
let p = blocks.as_ptr() as *const [u8; BLOCK_SIZE];
unsafe { core::slice::from_raw_parts(p, blocks.len()) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be worth to remove unsafe lines like this by adding a conversion method to the ArrayOps trait.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's save that for a followup, but I agree

//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array`,

extern crate test;

use digest::{bench_update, generic_array::typenum::U64};
use digest::{array::typenum::U64, bench_update};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use digest::{array::typenum::U64, bench_update};
use digest::{typenum::U64, bench_update};

extern crate test;

use digest::{bench_update, generic_array::typenum::U32};
use digest::{array::typenum::U32, bench_update};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use digest::{array::typenum::U32, bench_update};
use digest::{typenum::U32, bench_update};

extern crate test;

use digest::{bench_update, generic_array::typenum::U128};
use digest::{array::typenum::U128, bench_update};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use digest::{array::typenum::U128, bench_update};
use digest::{typenum::U128, bench_update};

//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U16>`,

use crate::compressor::Compressor;
use core::fmt;
use digest::{
array::typenum::{Unsigned, U28, U32, U48, U64},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
array::typenum::{Unsigned, U28, U32, U48, U64},
typenum::{Unsigned, U28, U32, U48, U64},

//! hasher.update(b"my message");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

//! hasher.update("The quick brown fox jumps over the lazy dog");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

//! hasher.update(b"hello world");
//!
//! // acquire hash digest in the form of GenericArray,
//! // acquire hash digest in the form of Array,
Copy link
Member

@newpavlov newpavlov Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! // acquire hash digest in the form of Array,
//! // acquire hash in the form of `hybrid_array::Array<u8, U32>`,

@tarcieri tarcieri changed the title Bump digest to v0.11.0-pre.2; MSRV 1.65 Bump digest to v0.11.0-pre.3; MSRV 1.71 Jan 6, 2024
@tarcieri tarcieri force-pushed the digest/v0.11.0-pre branch from fbd933f to 6fd20b4 Compare January 6, 2024 05:05
@tarcieri tarcieri force-pushed the digest/v0.11.0-pre branch from 6fd20b4 to 794bd1e Compare January 6, 2024 05:09
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do a follow-up PR a bit later.

@tarcieri tarcieri merged commit 7febf02 into master Jan 6, 2024
@tarcieri tarcieri deleted the digest/v0.11.0-pre branch January 6, 2024 06:14
tarcieri added a commit that referenced this pull request Jan 6, 2024
The new MSRV after #523 is 1.71
tarcieri added a commit that referenced this pull request Jan 6, 2024
The new MSRV after #523 is 1.71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants