Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
deuszex committed Jun 21, 2024
1 parent b992a5f commit 3a20cfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
12 changes: 5 additions & 7 deletions contract/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ pub extern "C" fn init() {
storage::new_uref(package_operator_mode).into(),
);

if vec![
if [
OwnerReverseLookupMode::Complete,
OwnerReverseLookupMode::TransfersOnly,
]
Expand Down Expand Up @@ -1755,13 +1755,11 @@ pub extern "C" fn get_approved() {
runtime::revert(NFTCoreError::PreviouslyBurntToken)
}

let maybe_approved = match utils::get_dictionary_value_from_key::<Option<Key>>(
let maybe_approved = utils::get_dictionary_value_from_key::<Option<Key>>(
APPROVED,
&token_identifier.get_dictionary_item_key(),
) {
Some(maybe_approved) => maybe_approved,
None => None,
};
)
.unwrap_or(None);

let approved_cl_value = CLValue::from_t(maybe_approved)
.unwrap_or_revert_with(NFTCoreError::FailedToConvertToCLValue);
Expand Down Expand Up @@ -2157,7 +2155,7 @@ pub extern "C" fn updated_receipts() {

#[no_mangle]
pub extern "C" fn register_owner() {
if vec![
if [
OwnerReverseLookupMode::Complete,
OwnerReverseLookupMode::TransfersOnly,
]
Expand Down
2 changes: 1 addition & 1 deletion contract/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub(crate) fn validate_metadata(
.map_err(|_| NFTCoreError::FailedToParseCustomMetadata)?;

for (property_name, property_type) in token_schema.properties.iter() {
if property_type.required && custom_metadata.attributes.get(property_name).is_none()
if property_type.required && !custom_metadata.attributes.contains_key(property_name)
{
runtime::revert(NFTCoreError::InvalidCustomMetadata)
}
Expand Down
1 change: 1 addition & 0 deletions contract/src/modalities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ impl FromBytes for TokenIdentifier {
}
}

#[allow(clippy::to_string_trait_impl)]
impl ToString for TokenIdentifier {
fn to_string(&self) -> String {
match self {
Expand Down

0 comments on commit 3a20cfc

Please sign in to comment.