Skip to content

Commit

Permalink
Merge pull request #171 from metaplex-foundation/chore/fixing-warnings
Browse files Browse the repository at this point in the history
Fixing minor Rust warnings
  • Loading branch information
blockiosaurus authored Jul 15, 2024
2 parents 8ff399b + be63281 commit f68350f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
18 changes: 1 addition & 17 deletions programs/mpl-core/src/plugins/lifecycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl ExternalCheckResult {

/// Bitfield representation of lifecycle permissions for external plugin adapter, third party plugins.
#[bitfield(bits = 32)]
#[derive(Eq, PartialEq, Copy, Clone, Debug)]
#[derive(Eq, PartialEq, Copy, Clone, Debug, Default)]
pub struct ExternalCheckResultBits {
pub can_listen: bool,
pub can_approve: bool,
Expand Down Expand Up @@ -1016,22 +1016,6 @@ pub(crate) trait PluginValidation {
abstain!()
}

/// Validate the add_authority lifecycle action.
fn validate_add_authority(
&self,
_ctx: &PluginValidationContext,
) -> Result<ValidationResult, ProgramError> {
abstain!()
}

/// Validate the add_authority lifecycle action.
fn validate_remove_authority(
&self,
_ctx: &PluginValidationContext,
) -> Result<ValidationResult, ProgramError> {
abstain!()
}

/// Validate the update_plugin lifecycle action.
fn validate_update_external_plugin_adapter(
&self,
Expand Down
6 changes: 4 additions & 2 deletions programs/mpl-core/src/plugins/plugin_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ impl ExternalRegistryRecord {
ExternalPluginAdapterUpdateInfo::LifecycleHook(update_info) => {
if let Some(checks) = &update_info.lifecycle_checks {
validate_lifecycle_checks(checks, false)?;
self.lifecycle_checks = update_info.lifecycle_checks.clone()
self.lifecycle_checks
.clone_from(&update_info.lifecycle_checks)
}
}
ExternalPluginAdapterUpdateInfo::Oracle(update_info) => {
if let Some(checks) = &update_info.lifecycle_checks {
validate_lifecycle_checks(checks, true)?;
self.lifecycle_checks = update_info.lifecycle_checks.clone()
self.lifecycle_checks
.clone_from(&update_info.lifecycle_checks)
}
}
_ => (),
Expand Down
2 changes: 1 addition & 1 deletion programs/mpl-core/src/plugins/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ pub fn initialize_external_plugin_adapter<'a, T: DataBlob + SolanaAccount>(
}

pub(crate) fn validate_lifecycle_checks(
lifecycle_checks: &Vec<(HookableLifecycleEvent, ExternalCheckResult)>,
lifecycle_checks: &[(HookableLifecycleEvent, ExternalCheckResult)],
can_reject_only: bool,
) -> ProgramResult {
if lifecycle_checks.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion programs/mpl-core/src/processor/burn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
state::{AssetV1, CollectionV1, CompressionProof, Key, SolanaAccount, Wrappable},
utils::{
close_program_account, load_key, rebuild_account_state_from_proof_data, resolve_authority,
validate_asset_permissions, validate_collection_permissions, verify_proof,
validate_asset_permissions, verify_proof,
},
};

Expand Down

0 comments on commit f68350f

Please sign in to comment.