Box

  1. 🌟
1. // Make it work
2. fn main() {
3. // Create a new box `b` that contains the integer 5
4. assert_eq!(*b, 5);

6. println!("Success!");
7. }
  1. 🌟
2. // Make it work
3. fn main() {
4. let b = Box::new("Hello");
5. print_boxed_string(b);
6. }

8. fn print_boxed_string(b : _) {
9. println!("{}", b);
10. }
  1. 🌟
2. // Make it work
3. fn main() {
4. let b1 = Box::new(5);
5. let b2 = b1;
6. assert_eq!(_, 5);

8. println!("Success!");
9. }
  1. 🌟
2. // Make it work
3. fn main() {
4. // Create a box `b` with an array [1, 2, 3, 4, 5]
5. // Print each integer in `b`
6. }

You can find the solutions here(under the solutions path), but only use it when you need it