Intro to Rust (Vectors, Hashmaps, Casting, If-let, while-let, and the Result Enum)

in #technology7 years ago (edited)

In this tutorial video, we look to filling a few of the gaps in our knowledge.  We look at the last major collection types in Rust, the Vector and the Hashmap.  Both the Vector and the Hashmap are very important collection types in Rust.  We also look at how we can coerce a primitive from one type to another using Casting.  This is a very useful construct because it lets us deal with some problems without having to re-create new types or new functions.  We look at some syntactic sugar statements in the If-Let and While-Let match/binding statements and we talk about how they are not as exhaustive as a proper Match statement.  They also allow us to write less verbose code as a result. Finally, we take a look at the Result Enum and how we can use it for error handling in a different way from the Option Enum.  

<iframe width="560" height="315" src="

" frameborder="0" gesture="media" allow="encrypted-media" allowfullscreen></iframe>

Edit: I just realized after re-watching the video that I misspoke a few times in the video (calling While-let if-while etc).  I was a exhausted when I made this video and I hope it does not detract from your learning experience. 


Sort:  

The @OriginalWorks bot has determined this post by @tensor to be original material and upvoted(1.5%) it!

ezgif.com-resize.gif

To call @OriginalWorks, simply reply to any post with @originalworks or !originalworks in your message!

Qurator
Your Quality Content Curator
This post has been upvoted and given the stamp of authenticity by @qurator. To join the quality content creators and receive daily upvotes click here for more info.

Qurator's exclusive support bot is now live. For more info click HERE or send some SBD and your link to @qustodian to get even more support.

Great post @tensor, thanks for sharing

thank you.

Really amazing post, I love it, got inspiration from you to start my journey.@tensor!

Cool, Ill have to take a look myself.

Congratulations @tensor! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes
Award for the number of comments
Award for the total payout received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

This post has received a 2.07 % upvote from @booster thanks to: @tensor.

This post has received a 5.87 % upvote from @sneaky-ninja thanks to: @tensor.

You have collected your daily Power Up! This post received an upvote worth of 0.25$.
Learn how to Power Up Smart here!

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.029
BTC 58049.95
ETH 3128.51
USDT 1.00
SBD 2.21