Skip to content

Commit e48ad33

Browse files
committed
fix: format don't add strings
1 parent 4aac2b6 commit e48ad33

2 files changed

Lines changed: 86 additions & 3 deletions

File tree

core/src/event_id.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,10 @@ impl Builder<Init> {
249249
impl Builder<WithNetwork> {
250250
// TODO sort_value should be bytes not str
251251
pub fn with_sort_value(mut self, sort_key: &str, sort_value: &str) -> Builder<WithSortValue> {
252-
self.state.bytes.extend(last8_bytes(&sha256_digest(
253-
&(sort_key.to_owned() + "|" + sort_value),
254-
)));
252+
self.state.bytes.extend(last8_bytes(&sha256_digest(&format!(
253+
"{}|{}",
254+
sort_key, sort_value,
255+
))));
255256
Builder {
256257
state: WithSortValue {
257258
bytes: self.state.bytes,

cspell.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"version": "0.2",
3+
"ignorePaths": [
4+
"*.lock"
5+
],
6+
"dictionaryDefinitions": [],
7+
"dictionaries": [],
8+
"words": [
9+
"aahed",
10+
"addrs",
11+
"ahash",
12+
"ahashs",
13+
"autonat",
14+
"behaviour",
15+
"bitswap",
16+
"btreestore",
17+
"cbor",
18+
"chacha",
19+
"cids",
20+
"cidv1",
21+
"codespan",
22+
"dagcbor",
23+
"Dcutr",
24+
"Deque",
25+
"eventid",
26+
"gossipsub",
27+
"hardline",
28+
"Hasher",
29+
"hashs",
30+
"ipfs",
31+
"ipld",
32+
"iroh",
33+
"irpc",
34+
"Kademlia",
35+
"kbucket",
36+
"kbuckets",
37+
"Keychain",
38+
"Keypair",
39+
"kubo",
40+
"lalrpop",
41+
"lib",
42+
"libipld",
43+
"libp2p",
44+
"listen_addrs",
45+
"mdns",
46+
"meshsub",
47+
"minicbor",
48+
"mockall",
49+
"Multiaddr",
50+
"multiaddrs",
51+
"multibase",
52+
"multicodec",
53+
"multiformat",
54+
"multiformats",
55+
"multihash",
56+
"oneshot",
57+
"opentelemetry",
58+
"otlp",
59+
"peerid",
60+
"preimage",
61+
"propernames",
62+
"PROTO",
63+
"quic",
64+
"quickcheck",
65+
"rusqlite",
66+
"serde",
67+
"softline",
68+
"sqlitestore",
69+
"streamid",
70+
"Substream",
71+
"termcolor",
72+
"unimock",
73+
"varint",
74+
"wordle",
75+
"wordlist",
76+
"zymic",
77+
"zythum"
78+
],
79+
"ignoreWords": [
80+
],
81+
"import": []
82+
}

0 commit comments

Comments
 (0)