Skip to content

Commit a1fa380

Browse files
lorenzleutgebFintanH
authored andcommitted
protocol: Depend on cypheraddr not cyphernet
`radicle-protocol` depends on `cyphernet`, but only uses the module `cyphernet::addr`, which is a re-export of `cypheraddr`, which is unnecessary (as `cypheraddr` alone would do), and invites accidentally pulling in more dependencies via `cyphernet`. To prevent accidentally depending on further types from `cyphernet`, change this to more conservativeley depend on `cypheraddr`.
1 parent d530f12 commit a1fa380

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ bytes = "1.11.1"
2525
chrono = { version = "0.4.26", default-features = false }
2626
colored = "2.1.0"
2727
crossbeam-channel = "0.5.6"
28+
cypheraddr = "0.4.0"
2829
cyphernet = "0.5.2"
2930
dunce = "1.0.5"
3031
fastrand = { version = "2.0.0", default-features = false }

crates/radicle-protocol/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ test = ["radicle/test", "radicle-crypto/test", "radicle-crypto/cyphernet", "qche
1515
bloomy = "1.2"
1616
bytes = { workspace = true }
1717
crossbeam-channel = { workspace = true }
18-
cyphernet = { workspace = true, features = ["tor"] }
18+
cypheraddr = { workspace = true, features = ["serde", "tor"] }
1919
fastrand = { workspace = true }
2020
log = { workspace = true, features = ["std"] }
2121
nonempty = { workspace = true, features = ["serialize"] }

crates/radicle-protocol/src/wire.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::string::FromUtf8Error;
1515

1616
use bytes::{Buf, BufMut};
1717

18-
use cyphernet::addr::tor;
18+
use cypheraddr::tor;
1919

2020
use radicle::crypto::{PublicKey, Signature, Unverified};
2121
use radicle::git;
@@ -257,7 +257,7 @@ impl Encode for Refs {
257257
}
258258
}
259259

260-
impl Encode for cyphernet::addr::tor::OnionAddrV3 {
260+
impl Encode for cypheraddr::tor::OnionAddrV3 {
261261
fn encode(&self, buf: &mut impl BufMut) {
262262
self.into_raw_bytes().encode(buf)
263263
}

crates/radicle-protocol/src/wire/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::{mem, net};
22

33
use bytes::Buf;
44
use bytes::BufMut;
5-
use cyphernet::addr::{tor, HostName, NetAddr};
5+
use cypheraddr::{tor, HostName, NetAddr};
66
use radicle::crypto::Signature;
77
use radicle::git::Oid;
88
use radicle::identity::RepoId;

0 commit comments

Comments
 (0)