From e1cfcca8db2168c3f66c12a44a20b8e68ed9a759 Mon Sep 17 00:00:00 2001 From: fh Date: Thu, 26 Sep 2024 23:12:23 +0800 Subject: [PATCH] fix lints --- Cargo.toml | 4 +--- Makefile | 2 +- README.md | 2 +- src/crypto/sig/ed25519/readable/mod.rs | 6 +++--- src/err/mod.rs | 6 ++---- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fd42ca5..c555c31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruc" -version = "6.0.0" +version = "6.0.1" authors = ["hui.fan@mail.ru"] edition = "2021" description = "Rust Util Collections" @@ -14,8 +14,6 @@ repository = "https://github.com/rust-util-collections/ruc.git" features = ["full"] [dependencies] -once_cell = "1.18" - sha3 = { version = "0.10.8", optional = true } ed25519-zebra = { version = "4.0.0", optional = true } diff --git a/Makefile b/Makefile index 341722a..7cac3e2 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ test: update: rustup update stable - cargo update + cargo update --verbose fmt: cargo +nightly fmt diff --git a/README.md b/README.md index 2c14346..dccd32a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Rust](https://github.com/rust-util-collections/ruc/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-util-collections/ruc/actions/workflows/rust.yml) [![Latest Version](https://img.shields.io/crates/v/RUC.svg)](https://crates.io/crates/RUC) [![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/RUC) -![Minimum rustc version](https://img.shields.io/badge/rustc-1.78+-lightgray.svg) +![Minimum rustc version](https://img.shields.io/badge/rustc-1.81+-lightgray.svg) # ruc diff --git a/src/crypto/sig/ed25519/readable/mod.rs b/src/crypto/sig/ed25519/readable/mod.rs index d1e486f..16b0deb 100644 --- a/src/crypto/sig/ed25519/readable/mod.rs +++ b/src/crypto/sig/ed25519/readable/mod.rs @@ -5,13 +5,13 @@ use std::fmt; pub use ed25519_zebra::SigningKey as RawSignKey; pub use ed25519_zebra::VerificationKey as RawVerifyKey; -#[cfg_attr(feature = "SerDe", derive(serde::Deserialize, serde::Serialize))] +#[derive(serde::Deserialize, serde::Serialize)] pub struct SignKey(String); -#[cfg_attr(feature = "SerDe", derive(serde::Deserialize, serde::Serialize))] +#[derive(serde::Deserialize, serde::Serialize)] pub struct VerifyKey(String); -#[cfg_attr(feature = "SerDe", derive(serde::Deserialize, serde::Serialize))] +#[derive(serde::Deserialize, serde::Serialize)] pub struct Sig(String); // in base64 format diff --git a/src/err/mod.rs b/src/err/mod.rs index ff685bc..a6024c5 100644 --- a/src/err/mod.rs +++ b/src/err/mod.rs @@ -30,15 +30,13 @@ use core::{ fmt::{Debug, Display}, }; -use std::{collections::HashSet, error::Error, sync::Mutex}; - -use once_cell::sync::Lazy; +use std::{collections::HashSet, error::Error, sync::LazyLock, sync::Mutex}; // avoid out-of-order printing static LOG_LK: Mutex<()> = Mutex::new(()); /// `INFO` or `ERROR`, if mismatch, default to `INFO` -pub static LOG_LEVEL: Lazy = Lazy::new(|| { +pub static LOG_LEVEL: LazyLock = LazyLock::new(|| { if let Ok(l) = std::env::var("RUC_LOG_LEVEL") { if "ERROR" == l { return "ERROR".to_owned();