mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-29 02:33:48 +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:
@@ -37,9 +37,9 @@ impl From<[u8; GRAFFITI_BYTES_LEN]> for Graffiti {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<[u8; GRAFFITI_BYTES_LEN]> for Graffiti {
|
||||
fn into(self) -> [u8; GRAFFITI_BYTES_LEN] {
|
||||
self.0
|
||||
impl From<Graffiti> for [u8; GRAFFITI_BYTES_LEN] {
|
||||
fn from(from: Graffiti) -> [u8; GRAFFITI_BYTES_LEN] {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ impl<'de> Deserialize<'de> for GraffitiString {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Graffiti> for GraffitiString {
|
||||
fn into(self) -> Graffiti {
|
||||
let graffiti_bytes = self.0.as_bytes();
|
||||
impl From<GraffitiString> for Graffiti {
|
||||
fn from(from: GraffitiString) -> Graffiti {
|
||||
let graffiti_bytes = from.0.as_bytes();
|
||||
let mut graffiti = [0; GRAFFITI_BYTES_LEN];
|
||||
|
||||
let graffiti_len = std::cmp::min(graffiti_bytes.len(), GRAFFITI_BYTES_LEN);
|
||||
|
||||
@@ -77,9 +77,9 @@ impl SelectionProof {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Signature> for SelectionProof {
|
||||
fn into(self) -> Signature {
|
||||
self.0
|
||||
impl From<SelectionProof> for Signature {
|
||||
fn from(from: SelectionProof) -> Signature {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ macro_rules! impl_from_into_u64 {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for $main {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
impl From<$main> for u64 {
|
||||
fn from(from: $main) -> u64 {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,9 @@ macro_rules! impl_from_into_usize {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<usize> for $main {
|
||||
fn into(self) -> usize {
|
||||
self.0 as usize
|
||||
impl From<$main> for usize {
|
||||
fn from(from: $main) -> usize {
|
||||
from.0 as usize
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,15 +150,15 @@ impl From<u64> for SubnetId {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for SubnetId {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
impl From<SubnetId> for u64 {
|
||||
fn from(from: SubnetId) -> u64 {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for &SubnetId {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
impl From<&SubnetId> for u64 {
|
||||
fn from(from: &SubnetId) -> u64 {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ impl SyncSelectionProof {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<Signature> for SyncSelectionProof {
|
||||
fn into(self) -> Signature {
|
||||
self.0
|
||||
impl From<SyncSelectionProof> for Signature {
|
||||
fn from(from: SyncSelectionProof) -> Signature {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,15 +78,15 @@ impl From<u64> for SyncSubnetId {
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for SyncSubnetId {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
impl From<SyncSubnetId> for u64 {
|
||||
fn from(from: SyncSubnetId) -> u64 {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Into<u64> for &SyncSubnetId {
|
||||
fn into(self) -> u64 {
|
||||
self.0
|
||||
impl From<&SyncSubnetId> for u64 {
|
||||
fn from(from: &SyncSubnetId) -> u64 {
|
||||
from.0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user