@@ -101,7 +101,7 @@ impl NodeInfo {
101
101
///
102
102
/// It will look like this:
103
103
/// node=b32encodednodeid derp=https://myderp.example
104
- pub fn into_attribute_string ( & self ) -> String {
104
+ pub fn to_attribute_string ( & self ) -> String {
105
105
let mut attrs = vec ! [ ] ;
106
106
attrs. push ( fmt_attr ( ATTR_NODE_ID , self . node_id ) ) ;
107
107
if let Some ( derp) = & self . derp_url {
@@ -159,22 +159,22 @@ impl NodeInfo {
159
159
160
160
/// Create a [`pkarr::SignedPacket`] by constructing a DNS packet and
161
161
/// signing it with a [`SecretKey`].
162
- pub fn into_pkarr_signed_packet (
162
+ pub fn to_pkarr_signed_packet (
163
163
& self ,
164
164
secret_key : & SecretKey ,
165
165
ttl : u32 ,
166
166
) -> Result < pkarr:: SignedPacket > {
167
- let packet = self . into_pkarr_dns_packet ( ttl) ?;
167
+ let packet = self . to_pkarr_dns_packet ( ttl) ?;
168
168
let keypair = pkarr:: Keypair :: from_secret_key ( & secret_key. to_bytes ( ) ) ;
169
169
let signed_packet = pkarr:: SignedPacket :: from_packet ( & keypair, & packet) ?;
170
170
Ok ( signed_packet)
171
171
}
172
172
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 > > {
174
174
use pkarr:: dns:: { self , rdata} ;
175
175
let name = dns:: Name :: new ( IROH_NODE_TXT_LABEL ) ?. into_owned ( ) ;
176
176
let rdata = {
177
- let value = self . into_attribute_string ( ) ;
177
+ let value = self . to_attribute_string ( ) ;
178
178
let txt = rdata:: TXT :: new ( ) . with_string ( & value) ?. into_owned ( ) ;
179
179
rdata:: RData :: TXT ( txt)
180
180
} ;
@@ -244,4 +244,3 @@ fn parse_attrs<'a>(s: &'a str) -> HashMap<&'a str, Vec<&'a str>> {
244
244
}
245
245
map
246
246
}
247
-
0 commit comments