Skip to content

Commit a513612

Browse files
committed
clippy fixes
Signed-off-by: Dave Huseby <[email protected]>
1 parent 8f1fd42 commit a513612

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/mk.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,19 @@ impl EncodingInfo for Multikey {
9292
}
9393
}
9494

95-
impl Into<Vec<u8>> for Multikey {
96-
fn into(self) -> Vec<u8> {
95+
impl From<Multikey> for Vec<u8> {
96+
fn from(mk: Multikey) -> Vec<u8> {
9797
let mut v = Vec::default();
9898
// add in the sigil
9999
v.append(&mut SIGIL.into());
100100
// add in the key codec
101-
v.append(&mut self.codec.clone().into());
101+
v.append(&mut mk.codec.into());
102102
// add in the comment
103-
v.append(&mut Varbytes(self.comment.as_bytes().to_vec()).into());
103+
v.append(&mut Varbytes(mk.comment.as_bytes().to_vec()).into());
104104
// add in the number of codec-specific attributes
105-
v.append(&mut Varuint(self.attributes.len()).into());
105+
v.append(&mut Varuint(mk.attributes.len()).into());
106106
// add in the codec-specific attributes
107-
self.attributes.iter().for_each(|(id, attr)| {
107+
mk.attributes.iter().for_each(|(id, attr)| {
108108
v.append(&mut (*id).into());
109109
v.append(&mut Varbytes(attr.to_vec()).into());
110110
});

src/nonce.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ impl AsRef<[u8]> for Nonce {
5555
}
5656
}
5757

58-
impl Into<Vec<u8>> for Nonce {
59-
fn into(self) -> Vec<u8> {
58+
impl From<Nonce> for Vec<u8> {
59+
fn from(n: Nonce) -> Vec<u8> {
6060
let mut v = Vec::default();
6161
// add the sigil
6262
v.append(&mut SIGIL.into());
6363
// add the nonce bytes
64-
v.append(&mut Varbytes(self.nonce.clone()).into());
64+
v.append(&mut Varbytes(n.nonce).into());
6565
v
6666
}
6767
}

0 commit comments

Comments
 (0)