Repository: paritytech/substrate
File: frame/nfts/src/impl_nonfungibles.rs (Rust)

Code before:
		collection: &Self::CollectionId,
		who: &T::AccountId,
		admin: &T::AccountId,
		disabled_settings: &CollectionSettings,
	) -> DispatchResult {
		let mut disabled_settings = *disabled_settings;
		// RequiredDeposit can be disabled by calling the force_create() only
		if disabled_settings.contains(CollectionSetting::RequiredDeposit) {
			disabled_settings.remove(CollectionSetting::RequiredDeposit);
		}
		Self::do_create_collection(
			*collection,
			who.clone(),
			admin.clone(),
			CollectionConfig::disable_settings(disabled_settings),
			T::CollectionDeposit::get(),
			Event::Created { collection: *collection, creator: who.clone(), owner: admin.clone() },
		)
	}
}

impl<T: Config<I>, I: 'static> Destroy<<T as SystemConfig>::AccountId> for Pallet<T, I> {
	type DestroyWitness = DestroyWitness;

	fn get_destroy_witness(collection: &Self::CollectionId) -> Option<DestroyWitness> {
		return Collection::<T, I>::get(collection).map(|a| a.destroy_witness())
	}

	fn destroy(
		collection: Self::CollectionId,
		witness: Self::DestroyWitness,
		maybe_check_owner: Option<T::AccountId>,
	) -> Result<Self::DestroyWitness, DispatchError> {
		Self::do_destroy_collection(collection, witness, maybe_check_owner)
	}
}

impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemSettings>
	for Pallet<T, I>
{
	fn mint_into(
		collection: &Self::CollectionId,
		item: &Self::ItemId,
		who: &T::AccountId,
		settings: &ItemSettings,
	) -> DispatchResult {
		Self::do_mint(*collection, *item, who.clone(), ItemConfig(*settings), |_| Ok(()))
	}

	fn burn(
		collection: &Self::CollectionId,

Review comment (suggestion):
```suggestion
		Collection::<T, I>::get(collection).map(|a| a.destroy_witness())
```

Code after:
	fn create_collection(
		collection: &Self::CollectionId,
		who: &T::AccountId,
		admin: &T::AccountId,
		config: &CollectionConfig,
	) -> DispatchResult {
		// DepositRequired can be disabled by calling the force_create() only
		ensure!(
			!config.has_disabled_setting(CollectionSetting::DepositRequired),
			Error::<T, I>::WrongSetting
		);
		Self::do_create_collection(
			*collection,
			who.clone(),
			admin.clone(),
			*config,
			T::CollectionDeposit::get(),
			Event::Created { collection: *collection, creator: who.clone(), owner: admin.clone() },
		)
	}
}

impl<T: Config<I>, I: 'static> Destroy<<T as SystemConfig>::AccountId> for Pallet<T, I> {
	type DestroyWitness = DestroyWitness;

	fn get_destroy_witness(collection: &Self::CollectionId) -> Option<DestroyWitness> {
		Collection::<T, I>::get(collection).map(|a| a.destroy_witness())
	}

	fn destroy(
		collection: Self::CollectionId,
		witness: Self::DestroyWitness,
		maybe_check_owner: Option<T::AccountId>,
	) -> Result<Self::DestroyWitness, DispatchError> {
		Self::do_destroy_collection(collection, witness, maybe_check_owner)
	}
}

impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemSettings>
	for Pallet<T, I>
{
	fn mint_into(
		collection: &Self::CollectionId,
		item: &Self::ItemId,
		who: &T::AccountId,
		settings: &ItemSettings,
	) -> DispatchResult {
		Self::do_mint(*collection, *item, who.clone(), ItemConfig(*settings))
	}

	fn burn(