main() -> Result<(), std::io::Error> { let content = std::fs::read("Cargo.toml"); // readはResult<Vec<u8>, std::io::Error>を返す let content = match content { Ok(x) => x, Err(x) => return Err(x), }; let content = String::from_utf8(content).unwrap(); let value = content.parse::<toml::Value>().unwrap(); dbg!(value); Ok(()) }