diff --git a/crates/nostr/src/event/builder.rs b/crates/nostr/src/event/builder.rs index 5f1586fdf..4768f215f 100644 --- a/crates/nostr/src/event/builder.rs +++ b/crates/nostr/src/event/builder.rs @@ -1973,7 +1973,7 @@ mod benches { pub fn builder_to_event(bh: &mut Bencher) { let keys = Keys::generate(); bh.iter(|| { - black_box(EventBuilder::text_note("hello", []).sign_with_keys(&keys)).unwrap(); + black_box(EventBuilder::text_note("hello").sign_with_keys(&keys)).unwrap(); }); } } diff --git a/crates/nostr/src/event/tag/mod.rs b/crates/nostr/src/event/tag/mod.rs index a40dc175f..63f528640 100644 --- a/crates/nostr/src/event/tag/mod.rs +++ b/crates/nostr/src/event/tag/mod.rs @@ -554,7 +554,7 @@ mod benches { #[bench] pub fn parse_p_tag(bh: &mut Bencher) { - let tag = &[ + let tag = [ "p", "13adc511de7e1cfcf1c6b7f6365fb5a03442d7bcacf565ea57fa7770912c023d", ]; @@ -576,7 +576,7 @@ mod benches { #[bench] pub fn parse_e_tag(bh: &mut Bencher) { - let tag = &[ + let tag = [ "e", "378f145897eea948952674269945e88612420db35791784abf0616b4fed56ef7", "wss://relay.damus.io", @@ -600,7 +600,7 @@ mod benches { #[bench] pub fn parse_a_tag(bh: &mut Bencher) { - let tag = &[ + let tag = [ "a", "30023:a695f6b60119d9521934a691347d9f78e8770b56da16bb255ee286ddf9fda919:ipsum", "wss://relay.nostr.org", diff --git a/crates/nostr/src/message/relay/mod.rs b/crates/nostr/src/message/relay/mod.rs index e1313d5c3..321b2a625 100644 --- a/crates/nostr/src/message/relay/mod.rs +++ b/crates/nostr/src/message/relay/mod.rs @@ -468,9 +468,9 @@ mod tests { // Event JSON with incomplete content let invalid_event_msg_content = r#"["EVENT", "random_string", {"id":"70b10f70c1318967eddf12527799411b1a9780ad9c43858f5e5fcd45486a13a5","pubkey":"379e863e8357163b5bce5d2688dc4f1dcc2d505222fb8d74db600f30535dfdfe"}]"#; - assert!(RelayMessage::from_json(invalid_event_msg).is_err(),); + assert!(RelayMessage::from_json(invalid_event_msg).is_err()); - assert!(RelayMessage::from_json(invalid_event_msg_content).is_err(),); + assert!(RelayMessage::from_json(invalid_event_msg_content).is_err()); } #[test] @@ -514,13 +514,13 @@ mod tests { assert!(RelayMessage::from_json( r#"["OK", "b1a649ebe8b435ec71d3784793f3bbf4b93e64e17568a741aecd4c7ddeafce30"]"# ) - .is_err(),); + .is_err()); // Invalid event_id assert!(RelayMessage::from_json( r#"["OK", "b1a649ebe8b435ec71d3784793f3bbf4b93e64e17568a741aecd4c7dde", true, ""]"# ) - .is_err(),); + .is_err()); // Invalid status assert!( diff --git a/crates/nostr/src/types/filter.rs b/crates/nostr/src/types/filter.rs index e39cf1013..a847fd011 100644 --- a/crates/nostr/src/types/filter.rs +++ b/crates/nostr/src/types/filter.rs @@ -1254,7 +1254,7 @@ mod benches { Tag::public_key(PublicKey::from_hex("b2d670de53b27691c0c3400225b65c35a26d06093bcc41f48ffc71e0907f9d4a").unwrap()), Tag::public_key(PublicKey::from_hex("379e863e8357163b5bce5d2688dc4f1dcc2d505222fb8d74db600f30535dfdfe").unwrap()), Tag::event(EventId::from_hex("7469af3be8c8e06e1b50ef1caceba30392ddc0b6614507398b7d7daa4c218e96").unwrap()), - Tag::from_standardized(TagStandard::Kind(Kind::TextNote)), + Tag::from_standardized(TagStandard::Kind { kind: Kind::TextNote, uppercase: false }), ], "test", Signature::from_str("273a9cd5d11455590f4359500bccb7a89428262b96b3ea87a756b770964472f8c3e87f5d5e64d8d2e859a71462a3f477b554565c4f2f326cb01dd7620db71502").unwrap(), diff --git a/crates/nostr/src/util/hex.rs b/crates/nostr/src/util/hex.rs index 90aca5187..0a7ba2298 100644 --- a/crates/nostr/src/util/hex.rs +++ b/crates/nostr/src/util/hex.rs @@ -158,7 +158,7 @@ mod benches { #[bench] pub fn hex_encode(bh: &mut Bencher) { bh.iter(|| { - black_box(encode(EVENT_JSON)); + black_box(encode(EVENT_JSON.as_bytes())); }); }