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

Error Handling #5

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) -> Result<i32, String> { let mut </i32,></p:>…