mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
according to the idea of gtm-nayan #144, add println!("Success") for each exercise
This commit is contained in:
@ -11,6 +11,8 @@ fn main() {
|
||||
|
||||
let c2 = '中';
|
||||
assert_eq!(size_of_val(&c2),3);
|
||||
|
||||
println!("Success!")
|
||||
}
|
||||
```
|
||||
|
||||
@ -31,13 +33,13 @@ fn print_char(c : char) {
|
||||
3. 🌟
|
||||
```rust, editable
|
||||
|
||||
// 让 println! 工作
|
||||
// make println! work
|
||||
fn main() {
|
||||
let _f: bool = false;
|
||||
|
||||
let t = true;
|
||||
if !t {
|
||||
println!("hello, world");
|
||||
println!("Success!")
|
||||
}
|
||||
}
|
||||
```
|
||||
@ -49,6 +51,8 @@ fn main() {
|
||||
let f = true;
|
||||
let t = true && false;
|
||||
assert_eq!(t, f);
|
||||
|
||||
println!("Success!")
|
||||
}
|
||||
```
|
||||
|
||||
@ -63,6 +67,8 @@ fn main() {
|
||||
|
||||
let v = (2, 3);
|
||||
assert_eq!(v, implicitly_ret_unit())
|
||||
|
||||
println!("Success!")
|
||||
}
|
||||
|
||||
fn implicitly_ret_unit() {
|
||||
@ -83,6 +89,8 @@ use std::mem::size_of_val;
|
||||
fn main() {
|
||||
let unit: () = ();
|
||||
assert!(size_of_val(&unit) == 4);
|
||||
|
||||
println!("Success!")
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user