From 2e2732663fc4cc692bfb2a3f084738972fd66002 Mon Sep 17 00:00:00 2001 From: dc <68939930+DappCoderr@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:44:58 +0530 Subject: [PATCH] Update: Remove the cast from the borrowNFT fun. Removing the cast to &{NonFungibleToken.NFT} as it's redundant and introduces potential warnings. --- docs/build/guides/nft.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/guides/nft.md b/docs/build/guides/nft.md index cb169b7c46..6f529bd551 100644 --- a/docs/build/guides/nft.md +++ b/docs/build/guides/nft.md @@ -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]...