Make clippy to be happy (#30394)

* replace default implementation with default enum

* fix format to make clippy happy
This commit is contained in:
kirill lykov 2023-02-17 20:51:18 +01:00 committed by GitHub
parent f91e63dfe9
commit ee1717b24b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -2820,7 +2820,7 @@ impl Node {
}
pub fn new_localhost_with_pubkey(pubkey: &Pubkey) -> Self {
let localhost_ip_addr = IpAddr::V4(Ipv4Addr::LOCALHOST);
let localhost_bind_addr = format!("{:?}:0", localhost_ip_addr);
let localhost_bind_addr = format!("{localhost_ip_addr:?}:0");
let unspecified_bind_addr = format!("{:?}:0", IpAddr::V4(Ipv4Addr::UNSPECIFIED));
let port_range = (1024, 65535);

View File

@ -48,8 +48,10 @@ pub trait WorkingSlot {
fn is_ancestor(&self, other: Slot) -> bool;
}
#[derive(Default)]
pub enum LoadedProgramType {
/// Tombstone for undeployed, closed or unloadable programs
#[default]
Invalid,
LegacyV0(VerifiedExecutable<RequisiteVerifier, InvokeContext<'static>>),
LegacyV1(VerifiedExecutable<RequisiteVerifier, InvokeContext<'static>>),
@ -68,12 +70,6 @@ impl Debug for LoadedProgramType {
}
}
impl Default for LoadedProgramType {
fn default() -> Self {
LoadedProgramType::Invalid
}
}
#[derive(Debug, Default)]
pub struct LoadedProgram {
/// The program of this entry