Merge pull request #387 from skaunov/patch-2

`from-into` small improvements
This commit is contained in:
Sunface
2023-04-09 21:05:29 +08:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,8 @@ fn main() {
assert_eq!(i1, 0);
// FIX the error in two ways
// 1. impl From<char> for ? , maybe you should check the docs mentiond above to find the answer
/* 1. use a similar type which `impl From<char>`, maybe you
should check the docs mentiond above to find the answer */
// 2. a keyword from the last chapter
let i3: i32 = 'a'.into();

View File

@ -22,7 +22,7 @@ fn main() {
assert_eq!(i1, i2);
assert_eq!(i1, 0);
let i3: u32 = 'a' as u32 ;
let i3: i32 = 'a' as i32 ;
let s: String = String::from('a');
}