From 31bf71d9878532d9b911cbac3ea9411f3f1e14ea Mon Sep 17 00:00:00 2001 From: Timothy Quilling Date: Tue, 4 Nov 2025 00:17:47 -0500 Subject: [PATCH] chore: lint --- parakeet-db/src/cid_util.rs | 12 ++++-------- parakeet-db/src/tid_util.rs | 3 +-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/parakeet-db/src/cid_util.rs b/parakeet-db/src/cid_util.rs index b084ca69..513e0b54 100644 --- a/parakeet-db/src/cid_util.rs +++ b/parakeet-db/src/cid_util.rs @@ -31,10 +31,6 @@ pub const BLOB_CID_HEADER: [u8; 4] = [0x01, 0x55, 0x12, 0x20]; /// 0x01 (CIDv1) + 0x71 (dag-cbor codec) + 0x1220 (SHA-256 multihash header) pub const RECORD_CID_HEADER: [u8; 4] = [0x01, 0x71, 0x12, 0x20]; -// Deprecated: Use BLOB_CID_HEADER or RECORD_CID_HEADER instead -#[deprecated(since = "0.1.0", note = "Use BLOB_CID_HEADER or RECORD_CID_HEADER")] -pub const CID_HEADER: [u8; 4] = RECORD_CID_HEADER; - /// Strip the CIDv1 header from a binary CID, returning only the 32-byte digest /// /// Accepts both blob CIDs (0x55 raw codec) and record CIDs (0x71 dag-cbor codec). @@ -172,8 +168,6 @@ mod tests { fn test_header_constants() { assert_eq!(BLOB_CID_HEADER, [0x01, 0x55, 0x12, 0x20]); assert_eq!(RECORD_CID_HEADER, [0x01, 0x71, 0x12, 0x20]); - #[allow(deprecated)] - assert_eq!(CID_HEADER, [0x01, 0x71, 0x12, 0x20]); } #[test] @@ -275,10 +269,12 @@ mod tests { #[test] fn test_invalid_digest_length() { let short_digest = vec![0xab; 16]; - assert!(digest_to_cid(&short_digest).is_none()); + assert!(digest_to_record_cid(&short_digest).is_none()); + assert!(digest_to_blob_cid(&short_digest).is_none()); let long_digest = vec![0xab; 64]; - assert!(digest_to_cid(&long_digest).is_none()); + assert!(digest_to_record_cid(&long_digest).is_none()); + assert!(digest_to_blob_cid(&long_digest).is_none()); } #[test] diff --git a/parakeet-db/src/tid_util.rs b/parakeet-db/src/tid_util.rs index 7e405224..dca382db 100644 --- a/parakeet-db/src/tid_util.rs +++ b/parakeet-db/src/tid_util.rs @@ -2,7 +2,6 @@ /// /// TIDs are 64-bit integers encoded in base32-sortable format. /// See: https://atproto.com/specs/tid - use std::fmt; /// Base32-sortable alphabet used by AT Protocol TIDs @@ -308,7 +307,7 @@ mod tests { #[test] fn test_tid_sortability() { // TIDs should maintain sort order after encoding - let values = vec![1000i64, 2000i64, 3000i64, 10000i64, 100000i64]; + let values = [1000i64, 2000i64, 3000i64, 10000i64, 100000i64]; let encoded: Vec = values.iter().map(|&v| encode_tid(v)).collect(); -- 2.51.2