This commit is contained in:
roneya
2024-03-12 18:05:37 +05:30
parent 68c285d97b
commit c478b37a0d

View File

@ -4,7 +4,7 @@
```rust,editable ```rust,editable
// Make it work // Make it work
fn main() { fn main() {
let b = Box::new(5); // Create a new box `b` that contains the integer 5
assert_eq!(*b, 5); assert_eq!(*b, 5);
println!("Success!"); println!("Success!");
@ -20,7 +20,7 @@ fn main() {
print_boxed_string(b); print_boxed_string(b);
} }
fn print_boxed_string(b : Box<&str>) { fn print_boxed_string(b : _) {
println!("{}", b); println!("{}", b);
} }
``` ```
@ -32,7 +32,7 @@ fn print_boxed_string(b : Box<&str>) {
fn main() { fn main() {
let b1 = Box::new(5); let b1 = Box::new(5);
let b2 = b1; let b2 = b1;
assert_eq!(*b2, 5); assert_eq!(_, 5);
println!("Success!"); println!("Success!");
} }