1
2pub fn get_random_joke() -> &'static str {
4 let jokes = [
5 "Why do Rustaceans never panic? Because they always handle their errors!",
6 "What did the Rust programmer say at the party? 'I'm borrowing happiness immutably.'",
7 "Why do Rust programmers love Ferris? Because he knows how to lifetimes.",
8 "How does a Rust developer break up with their partner?'I'm sorry, but I can't share ownership of this relationship anymore.",
9 "Rust programmers have the best relationships.They know how to manage lifetimes like pros!",
10 "In C we had to code our own bugs. In C++ we can inherit them.",
11 "Why don't Rustaceans need garbage collectors? Because they take out their own trash with drop.",
12 "Why did the Rust compiler join the marathon? To prove it's fast enough... but it always insists on double-checking everything first!",
13 "What do Rust developers do at stand-ups? They just borrow time and return ownership at the end.",
14 "Why do Rust programmers love constants? Because change is hard!",
15 "Why don't Rust programmers need wallets? Because they never own anything, they just borrow it!",
16 "C++ walks into a bar and forgets to pay its tab. Rust walks in and drops its ownership at the door.",
17 "In C++, you delete your memory manually. In Rust, the memory deletes you if you misuse it.",
18 "C++ lets you have null pointers and then blames you when you dereference them. Rust just says, 'Option or nothing!",
19 "C++: 'I'll let you shoot yourself in the foot.'Rust: 'Let me check your gun, your foot, and your intent first.",
20 "In C++, threads are like toddlers with scissors. In Rust, they're toddlers in padded rooms with safety scissors",
21 "C++ promises you multithreading. Rust promises you multithreading without tears.",
22 "Rust's compiler holds your hand. C++'s compiler slaps it away and says, 'Figure it out!",
23 "C++ makes you memorize everything about the language to avoid pitfalls. Rust just gives you lifelines and says, 'Go be productive.",
24 "Learning C++ is like learning to juggle knives blindfolded. Learning Rust is like learning to juggle—with safety nets and foam knives.",
25 ];
26 let index = rand::random::<usize>() % jokes.len();
27 jokes[index]
28}
29