2016-02-05から1日間の記事一覧
Filesystem Operations | Rust by Example ここがいい。
raw stringという。 json - The operator r#""# in Rust - Stack Overflow
use std::io::prelude::*; use std::fs::File; fn main() { let mut f = File::create("foo.txt").unwrap(); let x = r#" This is a "raw string literal," roughly equivalent to a heredoc. "#; f.write_all(x.as_bytes()); }
サンプルはmainがなかったので。 std::fs::File - Rust この辺をパックってそのままだと何故かエラー。 <std macros>:5:8: 6:42 error: mismatched types: expected `()`, found `core::result::Result<_, _>` (expected (), found enum `core::result::Result`) [E0308] <std macros>:5 re</std></_,></std>…