Skip to content

Commit

Permalink
Update nft.md
Browse files Browse the repository at this point in the history
In function borrowNFT_  NonFungibleToken type cast to `&{NFT}?` is redundant. To remove this error added Force Unwrap Operator (!).
  • Loading branch information
DappCoderr authored and joshuahannan committed Sep 19, 2024
1 parent 8ab0e1d commit 2b0fa6b
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] as &{NonFungibleToken.NFT}?)!
}
// ...[rest of code]...
Expand Down

0 comments on commit 2b0fa6b

Please sign in to comment.