mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
format code: format code in type-conversions/from-into
This commit is contained in:
@ -2,9 +2,9 @@
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
// impl From<bool> for i32
|
||||
let i1:i32 = false.into();
|
||||
let i2:i32 = i32::from(false);
|
||||
// impl From<bool> for i32
|
||||
let i1: i32 = false.into();
|
||||
let i2: i32 = i32::from(false);
|
||||
assert_eq!(i1, i2);
|
||||
assert_eq!(i1, 0);
|
||||
|
||||
@ -16,13 +16,13 @@ fn main() {
|
||||
|
||||
```rust
|
||||
fn main() {
|
||||
// impl From<bool> for i32
|
||||
let i1:i32 = false.into();
|
||||
let i2:i32 = i32::from(false);
|
||||
// impl From<bool> for i32
|
||||
let i1: i32 = false.into();
|
||||
let i2: i32 = i32::from(false);
|
||||
assert_eq!(i1, i2);
|
||||
assert_eq!(i1, 0);
|
||||
|
||||
let i3: i32 = 'a' as i32 ;
|
||||
let i3: i32 = 'a' as i32;
|
||||
|
||||
let s: String = String::from('a');
|
||||
}
|
||||
|
Reference in New Issue
Block a user