From 547edb04bebd048a0833cc1056c5c078e7b4e5d6 Mon Sep 17 00:00:00 2001 From: sevki Date: Wed, 6 Nov 2024 13:04:34 +0000 Subject: [PATCH] fix: lint errors --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 4 ++-- src/lib.rs | 4 ++-- src/oid.rs | 4 ++-- src/sha1.rs | 2 +- src/sha2.rs | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e2bd63..adae38d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -941,9 +941,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jetstream_derive" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84646200066b1d9b9f3a748c300f42fafdc62e5f503b0071d32ce9b42f6922c8" +checksum = "3ca131815a3997c4fdab189d39190549146a5085d47d9170d167af27acf60e45" dependencies = [ "convert_case", "paste", @@ -955,9 +955,9 @@ dependencies = [ [[package]] name = "jetstream_wireformat" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d2936b27f9523bfe360481cb6519fa6eadebe6f7e404b9a42167dd7125901ee" +checksum = "39de40a2f04a9f15c0d3facf619fc982b4017f9d8b13795d5bd342680bac66e0" dependencies = [ "bytes", "futures", @@ -1006,9 +1006,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libgit2-sys" @@ -1154,7 +1154,7 @@ dependencies = [ [[package]] name = "okid" -version = "0.1.38" +version = "0.1.39" dependencies = [ "async-graphql", "blake3", @@ -1725,9 +1725,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", diff --git a/Cargo.toml b/Cargo.toml index dd64c65..d23ff07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "okid" -version = "0.1.38" +version = "0.1.39" edition = "2021" readme = "README.md" description = "A library for gereating double clickable ids" @@ -14,7 +14,7 @@ digest = "0.10.7" enumflags2 = "0.7.10" git2 = { version = "0.18.3", optional = true, default-features = false } hex = { version = "0.4.3", features = ["serde"] } -jetstream_wireformat = "5.3.0" +jetstream_wireformat = "6.0.0" serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" sha1 = { version = "0.10.6", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 2675445..de28d6d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -169,8 +169,8 @@ pub struct OkId { digest: Digest, } -#[cfg(feature = "graphql")] /// OkId scalar for graphql +#[cfg(feature = "graphql")] async_graphql::scalar!(OkId); #[cfg(feature = "openapi")] @@ -193,6 +193,7 @@ impl PartialSchema for OkId { } } +/// OkId schema for openapi #[cfg(feature = "openapi")] impl ToSchema for OkId { fn name() -> std::borrow::Cow<'static, str> { @@ -804,7 +805,6 @@ mod okid_tests { #[cfg(feature = "sha1")] #[test] fn test_serde_file_sha1() { - let mut hasher = sha1::Sha1::new(); hasher.update(b"hello world"); let binary_id = OkId::from(hasher); diff --git a/src/oid.rs b/src/oid.rs index 2011be7..b5a6722 100644 --- a/src/oid.rs +++ b/src/oid.rs @@ -1,4 +1,4 @@ -use crate::{sha1::Sha1, BinaryType, CommonSettings, Digest}; +use crate::{sha1::Sha1, BinaryType, Digest}; use super::OkId; @@ -11,7 +11,7 @@ impl From for OkId { } Self { hash_type: BinaryType::Sha1, - digest: Digest::Sha1(Sha1( buf)), + digest: Digest::Sha1(Sha1(buf)), } } } diff --git a/src/sha1.rs b/src/sha1.rs index f4cb37e..4a52f02 100644 --- a/src/sha1.rs +++ b/src/sha1.rs @@ -36,7 +36,7 @@ impl Display for Sha1 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let data = self.0; let buf = &hex::encode(data); - f.write_str(&buf)?; + f.write_str(buf)?; Ok(()) } } diff --git a/src/sha2.rs b/src/sha2.rs index a049698..ee89c20 100644 --- a/src/sha2.rs +++ b/src/sha2.rs @@ -27,7 +27,7 @@ impl Display for Sha256 { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let data = self.0; let buf = &hex::encode(data); - f.write_str(&buf)?; + f.write_str(buf)?; Ok(()) } }