Skip to content

Commit 38c9359

Browse files
committed
chore: clippy
1 parent 0074237 commit 38c9359

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

iroh-net/src/discovery/pkarr_relay_publish.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl Publisher {
9292
}
9393
let _ = self.last_published.write().insert(info.clone());
9494
let signed_packet =
95-
info.into_pkarr_signed_packet(&self.config.secret_key, self.config.ttl)?;
95+
info.to_pkarr_signed_packet(&self.config.secret_key, self.config.ttl)?;
9696
self.pkarr_client
9797
.relay_put(&self.config.pkarr_relay, &signed_packet)
9898
.await?;

iroh-net/src/dns/node_info.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl NodeInfo {
101101
///
102102
/// It will look like this:
103103
/// node=b32encodednodeid derp=https://myderp.example
104-
pub fn into_attribute_string(&self) -> String {
104+
pub fn to_attribute_string(&self) -> String {
105105
let mut attrs = vec![];
106106
attrs.push(fmt_attr(ATTR_NODE_ID, self.node_id));
107107
if let Some(derp) = &self.derp_url {
@@ -159,22 +159,22 @@ impl NodeInfo {
159159

160160
/// Create a [`pkarr::SignedPacket`] by constructing a DNS packet and
161161
/// signing it with a [`SecretKey`].
162-
pub fn into_pkarr_signed_packet(
162+
pub fn to_pkarr_signed_packet(
163163
&self,
164164
secret_key: &SecretKey,
165165
ttl: u32,
166166
) -> Result<pkarr::SignedPacket> {
167-
let packet = self.into_pkarr_dns_packet(ttl)?;
167+
let packet = self.to_pkarr_dns_packet(ttl)?;
168168
let keypair = pkarr::Keypair::from_secret_key(&secret_key.to_bytes());
169169
let signed_packet = pkarr::SignedPacket::from_packet(&keypair, &packet)?;
170170
Ok(signed_packet)
171171
}
172172

173-
fn into_pkarr_dns_packet(&self, ttl: u32) -> Result<pkarr::dns::Packet<'static>> {
173+
fn to_pkarr_dns_packet(&self, ttl: u32) -> Result<pkarr::dns::Packet<'static>> {
174174
use pkarr::dns::{self, rdata};
175175
let name = dns::Name::new(IROH_NODE_TXT_LABEL)?.into_owned();
176176
let rdata = {
177-
let value = self.into_attribute_string();
177+
let value = self.to_attribute_string();
178178
let txt = rdata::TXT::new().with_string(&value)?.into_owned();
179179
rdata::RData::TXT(txt)
180180
};
@@ -244,4 +244,3 @@ fn parse_attrs<'a>(s: &'a str) -> HashMap<&'a str, Vec<&'a str>> {
244244
}
245245
map
246246
}
247-

0 commit comments

Comments
 (0)