Skip to content

Commit

Permalink
fix: attempt to fix all clippy warnings related to solana
Browse files Browse the repository at this point in the history
  • Loading branch information
frolvanya committed Feb 1, 2025
1 parent 8682729 commit c2e2d65
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
pub struct FinalizeTransfer<'info> {
#[account(
init_if_needed,
space = USED_NONCES_ACCOUNT_SIZE as usize,
space = usize::try_from(USED_NONCES_ACCOUNT_SIZE).unwrap(),
payer = common.payer,
seeds = [
USED_NONCES_SEED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct FinalizeTransferSol<'info> {
pub config: Box<Account<'info, Config>>,
#[account(
init_if_needed,
space = USED_NONCES_ACCOUNT_SIZE as usize,
space = usize::try_from(USED_NONCES_ACCOUNT_SIZE).unwrap(),
payer = common.payer,
seeds = [
USED_NONCES_SEED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ pub mod state;
include!(concat!(env!("OUT_DIR"), "/program_id.rs"));

#[program]
#[allow(clippy::needless_pass_by_value)]
pub mod bridge_token_factory {
use super::*;
use super::{
msg, Context, DeployToken, DeployTokenPayload, FinalizeTransfer, FinalizeTransferPayload,
FinalizeTransferSol, InitTransfer, InitTransferPayload, InitTransferSol, Initialize, Key,
LogMetadata, Pubkey, Result, SignedPayload,
};

pub fn initialize(
ctx: Context<Initialize>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use crate::error::ErrorCode;
use super::config::Config;

#[cfg(not(feature = "idl-build"))]
#[allow(clippy::as_conversions)]
#[account(zero_copy(unsafe))]
#[repr(C)]
pub struct UsedNonces {
Expand All @@ -24,6 +25,7 @@ pub struct UsedNonces {
pub struct UsedNonces {}

impl UsedNonces {
#[allow(clippy::as_conversions)]
pub fn full_rent(rent: &Rent) -> u64 {
rent.minimum_balance(USED_NONCES_ACCOUNT_SIZE as usize)
}
Expand Down

0 comments on commit c2e2d65

Please sign in to comment.