mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Signed-off-by: roneya <iamrohanvidhate@gmail.com>
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
```rust,editable
|
||||
// Make it work
|
||||
fn main() {
|
||||
let b = Box::new(5);
|
||||
// Create a new box `b` that contains the integer 5
|
||||
assert_eq!(*b, 5);
|
||||
|
||||
println!("Success!");
|
||||
@ -20,7 +20,7 @@ fn main() {
|
||||
print_boxed_string(b);
|
||||
}
|
||||
|
||||
fn print_boxed_string(b : Box<&str>) {
|
||||
fn print_boxed_string(b : _) {
|
||||
println!("{}", b);
|
||||
}
|
||||
```
|
||||
@ -32,7 +32,7 @@ fn print_boxed_string(b : Box<&str>) {
|
||||
fn main() {
|
||||
let b1 = Box::new(5);
|
||||
let b2 = b1;
|
||||
assert_eq!(*b2, 5);
|
||||
assert_eq!(_, 5);
|
||||
|
||||
println!("Success!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user