fix: lint errors

This commit is contained in:
sevki 2024-11-06 13:04:34 +00:00
parent d405ee17f5
commit 547edb04be
6 changed files with 17 additions and 17 deletions

18
Cargo.lock generated
View file

@ -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",

View file

@ -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 }

View file

@ -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);

View file

@ -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<git2::Oid> for OkId {
}
Self {
hash_type: BinaryType::Sha1,
digest: Digest::Sha1(Sha1( buf)),
digest: Digest::Sha1(Sha1(buf)),
}
}
}

View file

@ -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(())
}
}

View file

@ -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(())
}
}