mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
chore: change impl Into<T> for U to impl From<U> for T (#5948)
* chore: Change Into trait impl for KzgProof to From trait impl * chore: change `impl Into <T> for U` to `impl From<U> for T` * chore: remove `from-over-into` clippy lint exception
This commit is contained in:
@@ -14,9 +14,9 @@ pub enum ChecksumFunction {
|
||||
Sha256,
|
||||
}
|
||||
|
||||
impl Into<String> for ChecksumFunction {
|
||||
fn into(self) -> String {
|
||||
match self {
|
||||
impl From<ChecksumFunction> for String {
|
||||
fn from(from: ChecksumFunction) -> String {
|
||||
match from {
|
||||
ChecksumFunction::Sha256 => "sha256".into(),
|
||||
}
|
||||
}
|
||||
@@ -38,8 +38,8 @@ impl TryFrom<String> for ChecksumFunction {
|
||||
#[serde(try_from = "Value", into = "Value")]
|
||||
pub struct EmptyMap;
|
||||
|
||||
impl Into<Value> for EmptyMap {
|
||||
fn into(self) -> Value {
|
||||
impl From<EmptyMap> for Value {
|
||||
fn from(_from: EmptyMap) -> Value {
|
||||
Value::Object(Map::default())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ pub enum CipherFunction {
|
||||
Aes128Ctr,
|
||||
}
|
||||
|
||||
impl Into<String> for CipherFunction {
|
||||
fn into(self) -> String {
|
||||
match self {
|
||||
impl From<CipherFunction> for String {
|
||||
fn from(from: CipherFunction) -> String {
|
||||
match from {
|
||||
CipherFunction::Aes128Ctr => "aes-128-ctr".into(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ impl From<Vec<u8>> for HexBytes {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<String> for HexBytes {
|
||||
fn into(self) -> String {
|
||||
hex::encode(self.0)
|
||||
impl From<HexBytes> for String {
|
||||
fn from(from: HexBytes) -> String {
|
||||
hex::encode(from.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ pub struct KdfModule {
|
||||
#[serde(try_from = "String", into = "String")]
|
||||
pub struct EmptyString;
|
||||
|
||||
impl Into<String> for EmptyString {
|
||||
fn into(self) -> String {
|
||||
impl From<EmptyString> for String {
|
||||
fn from(_from: EmptyString) -> String {
|
||||
"".into()
|
||||
}
|
||||
}
|
||||
@@ -91,9 +91,9 @@ pub enum KdfFunction {
|
||||
Pbkdf2,
|
||||
}
|
||||
|
||||
impl Into<String> for KdfFunction {
|
||||
fn into(self) -> String {
|
||||
match self {
|
||||
impl From<KdfFunction> for String {
|
||||
fn from(from: KdfFunction) -> String {
|
||||
match from {
|
||||
KdfFunction::Scrypt => "scrypt".into(),
|
||||
KdfFunction::Pbkdf2 => "pbkdf2".into(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user