2017-03-07から1日間の記事一覧

Error Handling #4

https://doc.rust-lang.org/book/error-handling.html use std::fs::File; use std::io::Read; use std::path::Path; fn file_double<P: AsRef<Path>>(file_path: P) -> i32 { let mut file = File::open(file_path).unwrap(); // error 1 let mut contents = String::new()</p:>…