Update rust edition to 2021 (#749)

* build: update rust edition 2021

* cargo: format all

* build: fix tests and warnings
This commit is contained in:
ardocrat
2026-05-14 12:58:22 +02:00
committed by GitHub
parent a3e71a8b2d
commit 602d79e868
17 changed files with 25 additions and 18 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ repository = "https://github.com/mimblewimble/grin-wallet"
keywords = [ "crypto", "grin", "mimblewimble" ]
exclude = ["**/*.grin", "**/*.grin2"]
#build = "src/build/build.rs"
edition = "2018"
edition = "2021"
[dependencies]
blake2-rfc = "0.2"
@@ -117,11 +117,13 @@ impl Writeable for DalekPublicKey {
}
/// Encapsulates an ed25519_dalek::Signature and provides (de-)serialization
#[allow(dead_code)]
#[derive(Clone, Debug, PartialEq)]
pub struct DalekSignature(Signature);
impl DalekSignature {
/// Convert hex string to DalekSignature.
#[allow(dead_code)]
pub fn from_hex(hex: &str) -> Result<Self, DalekError> {
let bytes = grin_util::from_hex(hex)
.map_err(|_| DalekError::HexError(format!("failed to decode {}", hex)))?;
@@ -131,6 +133,7 @@ impl DalekSignature {
}
/// Verifies DalekSignature
#[allow(dead_code)]
pub fn verify(&self, pk: &DalekPublicKey, msg: &[u8]) -> Result<(), DalekError> {
pk.as_ref()
.verify(&msg, &self.0)