Closures - Rust

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 พ.ย. 2024

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

  • @jjjunkie
    @jjjunkie 2 ปีที่แล้ว +1

    Great job at keeping to the point - most other youtubers introduce a hundred other concepts that complicate the topic being explained.

  • @ElijahLM01
    @ElijahLM01 4 ปีที่แล้ว +6

    youre honestly the best source ive found to learn rust aside from the official docs. i cant believe your videos dont have more views. i have close to 1000 lines of notes from this series and i feel like i have a way, way better understanding of rust now. thank you and keep it up!

    • @danlogs
      @danlogs  4 ปีที่แล้ว +1

      Thank you so much! This really warms my heart and I think there's no better motivation to keep me going ッ

  • @benjahnz
    @benjahnz 2 ปีที่แล้ว

    Excellent job explaining a tricky subject. Nice simple examples and no ego. Thanks dude.

  • @angelbythewings
    @angelbythewings 2 ปีที่แล้ว

    wow this is the first time i have truly understood closures in rust.

  • @kid_kulafu_1727
    @kid_kulafu_1727 3 ปีที่แล้ว +1

    Jesus, I've read the documentation for an hour and didn't understand Fn, FnMut and FnOnce especially that move keyword until I've watch your videos. Thanks much bro. You should create a video for each topic explaining RUST BY EXAMPLE that would be a good content.

  • @CodeWithVlad
    @CodeWithVlad 3 ปีที่แล้ว

    Very nice tutorial!

  • @thachnnguyen
    @thachnnguyen 2 ปีที่แล้ว +1

    By your demo, why bother with move? Missing the context why move is required.

    • @danlogs
      @danlogs  2 ปีที่แล้ว

      You are correct~ The 𝚖𝚘𝚟𝚎 in my example at the end was absolutely not required. I added it solely to show that, if we want, it is possible for a closure to take ownership of things. In one of my upcoming videos, I'll be talking about concurrency in Rust, and I'll show you then an example of when 𝚖𝚘𝚟𝚎 is required.

  • @samighasemi3333
    @samighasemi3333 3 ปีที่แล้ว

    Thank you!

  • @chon-850
    @chon-850 4 ปีที่แล้ว +1

    Great content!

  • @iamgabrielsoft5891
    @iamgabrielsoft5891 2 ปีที่แล้ว

    Well explained, I can't get any from TH-cam

  • @theartist8835
    @theartist8835 4 ปีที่แล้ว

    why are you not using integrated terminal in vsc ?

    • @danlogs
      @danlogs  4 ปีที่แล้ว +1

      Honestly, no reason ~ I use it now 🤷

  • @ClearerThanMud
    @ClearerThanMud 4 ปีที่แล้ว +2

    Nice work, Dan. Here in the video
    th-cam.com/video/ZkSI2sptSko/w-d-xo.html
    is it really that we've done an immutable borrow? I would have said that that was because a copy was made of the i32, and the *copy* was moved. Wouldn't you have to use &x to demonstrate a shared borrow?

    • @danlogs
      @danlogs  4 ปีที่แล้ว +1

      Oof, you are correct! I missed an ampersand 🤦‍♂️
      I'll add a note in the video's description ~ thanks for catching it and letting me know ^^

  • @chakorau4094
    @chakorau4094 4 ปีที่แล้ว

    what terminal is that

    • @danlogs
      @danlogs  4 ปีที่แล้ว

      It's called Hyper! ~ totally recommend it :p

  • @jcbritobr
    @jcbritobr 4 ปีที่แล้ว

    This is a closure or a lambda?

    • @danlogs
      @danlogs  4 ปีที่แล้ว +2

      Both! The terms are used interchangeably in Rust ~ check this out: doc.rust-lang.org/stable/rust-by-example/fn/closures.html