From 744915b06dde403396069545a261d8e7362ddf7e Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 11 Feb 2021 19:55:39 +0000 Subject: [PATCH] panic review --- subjects/panic/README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/subjects/panic/README.md b/subjects/panic/README.md index cb24962c..2f996c92 100644 --- a/subjects/panic/README.md +++ b/subjects/panic/README.md @@ -2,20 +2,28 @@ ### Instructions -Write a function that tries to open a file and panics if the file -doesn't exist +Write a **function** that tries to open a file and panics if the file +does not exist. + +### Notions ### Expected Function ```rust -pub fn open_file(s: &str) -> File {} +pub fn open_file(s: &str) -> File { + +} ``` ### Usage -Here is a program to test your function +Here is a program to test your function: ```rust +use std::fs::File; +use std::fs; +use panic::*; + fn main() { let filename = "created.txt"; File::create(filename).unwrap();