Unit Type | Rust Language

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 พ.ค. 2024
  • What is Unit type? How is different from None? This video looks at the differences.
    We also look at an example from "Rust in a month of lunches" and see how unit type works with a match arm
    Linux Hosting - VPS server - Webdock
    ----------------------------------------------------------------
    🟩 Webdock Linux Hosting : webdock.io/en?maff=wdaff--170
    Nostr
    ---------
    @RngWeb
    findthatbit@iris.to
    findthatbit.info/
    redandgreen.co.uk/
    #Rust #unit #rustlang

ความคิดเห็น • 2

  • @scottb4029
    @scottb4029 23 วันที่ผ่านมา +1

    I completely agree that you have to go over Rust again and again

    • @learning_rust
      @learning_rust  23 วันที่ผ่านมา

      100% Agree.
      It's not easy, a bit like doing a 1000 piece jigsaw puzzle, but as pieces fit together progress does speed up. eg. for loop implicitly calls into_iter() on a collection, I only fully understood this recently.
      I tend study from 2 books and then strip the examples right back to the minimum and memorise the part I want to really grasp.
      (Usually by typing it in from scratch once a day for a few days/weeks, a bit like learning a piece of music maybe?).