Back to Browse

practicing closures | Rust Language

168 views
Jan 31, 2025
7:05

Closures are widely used in Rust. Let's create a function to use a closure, and also look at how the compiler inferences the type. This is just a bit of a tea-break workout. Hope you find it useful. Using a closure in a function makes my head hurt, but it's cool, no? https://doc.rust-lang.org/reference/types/closure.html Rust Playground Example : ------------------------------------------ ✅ https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a7f430e7f85889e9aaa64c8d7c09ff86 #rustdevelopment #learningrust #rustlang

Download

1 formats

Video Formats

360pmp48.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

practicing closures | Rust Language | NatokHD