Beginner's Guide to Rust Data Types and Variables 🦀

Поділитися
Вставка
  • Опубліковано 6 лис 2024

КОМЕНТАРІ • 30

  • @liquidmobius
    @liquidmobius 7 місяців тому +3

    You seriously have the best Rust tutorials on YT! I'm really struggling with strings, more specifically the difference between String and &str (string slice), how are they defined and implemented, how to reference them, and how to work with them in general, especially regarding i/o. I'm sure you're really busy, but maybe you could consider covering this in a video. Thanks!

  • @sdlfljdfkl
    @sdlfljdfkl 8 місяців тому +1

    I just discovered your videos, and I like them! Clear and to the point! I would rather say that the unit type is a type with only one value, so it's not really empty. And that value is the empty tuple: so the unit type is the type of the empty tuple.

  • @kipkoech_nicholas
    @kipkoech_nicholas 4 місяці тому

    Watching this from Kenya and I can say I love your videos so much and it is helping me grow in the Rusty journey

    • @TrevorSullivan
      @TrevorSullivan  4 місяці тому

      @@kipkoech_nicholas congratulations on learning Rust programming! Thanks so much for your kind comment. I'm very happy to hear that you're benefiting from this video series. ❤️

  • @FaisalMalik-e3d
    @FaisalMalik-e3d 8 місяців тому

    i was struggling to find a good course on rust as i am learning as my first programming language kind of, i do have a bit knowledge in c++ as i am doing competitive programmer(a beginner though), done no projects so i was struggling to get a course which will consider that someone might be learning some concepts for the first time. hope you continue growing and keep helping others !!

  • @fuhrmanns
    @fuhrmanns Рік тому

    Your videos are really well done and the way you explain makes it easy to follow. Thanks!

  • @gameisntover1289
    @gameisntover1289 3 місяці тому

    Thanks for sharing your experiences :)

  • @jasonbraithwaite9204
    @jasonbraithwaite9204 6 місяців тому

    Excellent tutorial, very well explained, thank you for this :)

  • @ricardonogueira2213
    @ricardonogueira2213 8 місяців тому

    Nice content.
    Just would like to point out that signed ints don't have a bit to mark the sign. They are just interpreted differently.
    The number range is interpreted differently but both signed and unsigned (i8 and u8) have 256 possible values.

    • @TrevorSullivan
      @TrevorSullivan  8 місяців тому +1

      Oops, duh. That was a dumb mistake. Thanks for pointing that out

  • @TrevorSullivan
    @TrevorSullivan  Рік тому +2

    Check out the full Rust programming playlist! 🦀 ua-cam.com/play/PLDbRgZ0OOEpUkWDGqp91ODn0dk7LPBAUL.html

    • @cincooitodois
      @cincooitodois 5 місяців тому

      thank you very much, trevor! youre awesome! really appreciate it

  • @suvajitchakrabarty
    @suvajitchakrabarty 3 місяці тому

    Great video. Which of your videos can I check out for understanding borrowing and ownership?

    • @TrevorSullivan
      @TrevorSullivan  3 місяці тому

      @@suvajitchakrabarty thanks! I haven't created one specifically on that topic yet

  • @mozark1043
    @mozark1043 6 місяців тому

    Small question, How do you get the lint suggestions on the same line as the code (in red)? I have to hover my mouse over the squiggly lines but I really like the way yours is shown.

    • @TrevorSullivan
      @TrevorSullivan  6 місяців тому +1

      I think that's from an extension called Error Lens. I agree it's really nice to see it on the same line!

  • @FentForEnt
    @FentForEnt 5 місяців тому

    this was a great tutorial

  • @pranithreddy
    @pranithreddy 5 місяців тому +1

    How is your code getting auto compelete any free tool.

    • @TrevorSullivan
      @TrevorSullivan  5 місяців тому +1

      Yes check out my first video on Rust, where we talk about the Rust Analyzer extension for VSCode!

  • @yotubecreators47
    @yotubecreators47 Рік тому

    Super helpful! thank you

  • @falkenxx
    @falkenxx 7 місяців тому

    My version of rust-analyzer (latest as of this posting) does not show the red highlighted error text snippet, I have to roll over the error zone to get a popup with the error. How did you configure yours to do the red error text snippet overlay?

    • @TrevorSullivan
      @TrevorSullivan  7 місяців тому +2

      Good question! I just had to look that up myself. I have the Error Lens extension installed. Apparently that is what enables that functionality, showing the error text on the line!

  • @ashisharya65
    @ashisharya65 Рік тому

    Hi @TrevorSullivan,
    Great Video. Could you please let us know the features which has made you to learn Rust programming language.

    • @TrevorSullivan
      @TrevorSullivan  Рік тому

      Hello Ashish! Thank you for your kind comment. Rust is a lower level compiled language that offers much higher performance than interpreted scripting languages.

  • @smartwashington1455
    @smartwashington1455 10 місяців тому +1

    ❤ wonderful

  • @simonkalu
    @simonkalu 7 місяців тому

    Awesome...

  • @movieland8513
    @movieland8513 Рік тому

    what is the theme vs?

    • @TrevorSullivan
      @TrevorSullivan  Рік тому

      It's called Outrun in the extension marketplace!

  • @drac8854
    @drac8854 11 місяців тому

    10:45 by using "as" does it convert value of x to u8 or it just takes the u8 part of x and subtract 5 from it and asgine it to y?

    • @Hellbending
      @Hellbending 10 місяців тому +2

      It is a type conversion that’s handled at compile time when being changed to assembly/byte code.
      There is no direct number of ‘5’ in binary, its 0101.
      Sizing of digits (unsigned or otherwise) are only relevant to the compiler to know how many “slots” the digit has access to/can take up.
      Take 8 slots for instance, it can only store 255 as a maximum cos there literally no other space for digits in a register that large/small
      (11111111) for instance.
      If you want to go higher you either need more slots, or you cause ‘buffer overflow’ which means it wraps around and is why in some games if you say… hack your money or it bugs out you end up with negative money. Because the value went over whatever the maximum was and went from a positive integer to a negative one due to overflowing and wrapping around.