
Mr. Rust
@code_rusty
Rust + Solana Dev in training Building daily. DM to connect.
Published my first CLI tool in Rust: smart_tasker Command-line task tracker using - clap - serde Supports: add, list, complete, delete Published: crates.io/crates/smart_t… Please check !!
🚀Question 205: What does this print?🦀 fn main() { let arr = [10, 20, 30]; let mut iter = arr.iter().rev(); println!("{:?}", iter.next()); println!("{:?}", ()); }
Q204🦀: fn main() { let s1 = String::from("abc"); let s2 = String::from("defg"); let t = { let r1 = s1.as_str(); let r2 = s2.as_str(); if r1.len() > r2.len() { r1 } else { r2 } }; println!("{}", t); }
🚀 Question 203: What is the output? 🦀 fn main() { let s1 = String::from("hi"); let s2 = String::from("rust"); let r: &str; { r = if s1.len() > s2.len() { &s1 } else { &s2 }; } println!("{}", r); }
Q: 202🦀 fn main() { let v = vec![1, 2, 3]; let mut iter = v.into_iter(); println!("{:?}", iter.next()); println!("{:?}", ()); println!("{:?}", ()); println!("{:?}", ()); }
🚀 Question 201: What does this program print? 🦀 fn main() { let mut s = String::from("rust"); { let r = &mut s; r.push_str("ace"); } println!("{}", s); }
🚀 Question 200: What will this print? 🦀 ```rust fn main() { let v = vec![1, 2, 3]; let iter = v.iter(); drop(v); for x in iter { println!("{}", x); } } ```
Web3 in JavaScript: “ship fast, break things.” Web3 in Rust: “ship once, pray never.”
🚀 Question 199: In Rust, what happens when your landlord sells the house? Do you still get to be the tenant? 🦀 ```rust fn main() { let s1 = String::from("hi"); let s2 = &s1; let s3 = s1; println!("{}", s2); } ```
🚀Question 198: What is the output?🦀 fn main() { let data = vec!["a", "bb", "ccc"]; let max = data.iter() .max_by_key ( |s| s.len () ) .unwrap (); println!("{}", max); }
Rust doesn’t have garbage collection. It has you, collecting your own garbage at compile time.
🚀Question 197: What happens here?🦀 fn main() { let mut v = vec! [1, 2, 3 ] ; let a = &v[0] ; v.push(4) ; println!("{}", a) ; }
🚀Question 196: What will be printed?🦀 fn main() { let mut n = 1; let f = || { n += 2; }; f(); println!("{}", n); }
🚀Question 195: What happens?🦀 fn main() { let v = vec![1, 2, 3]; for i in v { println!("{}", i); } println!("{}", v[0]); }
🚀Question 194: What is the output?🦀 fn main() { let x = 5; let y = &x; println!("{}", *y + 1); }
🚀Question 192: In serde_json, what does serde_json::to_string(&value)? return?🦀
🚀Question 190: In the serde crate, what does #[serde(skip)] do?🦀
United States เทรนด์
- 1. #2025MAMAVOTE 1.3M posts
- 2. Fetterman 64K posts
- 3. #KonamiWorldSeriesSweepstakes N/A
- 4. Tyla 14.5K posts
- 5. Deport Harry Sisson 23.6K posts
- 6. No Kings 143K posts
- 7. Somalia 30.4K posts
- 8. #thursdayvibes 3,478 posts
- 9. #ThursdayThoughts 2,482 posts
- 10. Andrade 6,307 posts
- 11. Mila 17.1K posts
- 12. Ninja Gaiden 23.9K posts
- 13. #SpiritDay 1,086 posts
- 14. Turkey Leg Hut N/A
- 15. Dave Dombrowski N/A
- 16. Jennifer Welch 7,479 posts
- 17. Starting 5 7,192 posts
- 18. Dead or Alive 21.6K posts
- 19. Deloitte 14.8K posts
- 20. Tomonobu Itagaki 17.8K posts
Something went wrong.
Something went wrong.