unwrap
vs
expect
很像,也是遇到错误直接
panic
,但是会带上自定义的错误提示信息,相当于重载了错误打印的函数
let f = File::open("hello.txt").expect("Failed to open hello.txt");
?
传播错误