Skip to content

Commit

Permalink
Update: Remove the cast from the borrowNFT fun.
Browse files Browse the repository at this point in the history
Removing the cast to &{NonFungibleToken.NFT} as it's redundant and introduces potential warnings.
  • Loading branch information
DappCoderr authored Sep 19, 2024
1 parent c30a991 commit 00bdd28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/build/guides/nft.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ access(all) contract FooBar: NonFungibleToken {
/// Allows a caller to borrow a reference to a specific NFT
/// so that they can get the metadata views for the specific NFT
access(all) view fun borrowNFT(_ id: UInt64): &{NonFungibleToken.NFT}? {
return (&self.ownedNFTs[id] as &{NonFungibleToken.NFT}?)!
return &self.ownedNFTs[id]
}
// ...[rest of code]...
Expand Down

0 comments on commit 00bdd28

Please sign in to comment.