From 2c6c4b6cbc51f156e52de4b35af758cd47e1e710 Mon Sep 17 00:00:00 2001 From: davhojt Date: Fri, 27 May 2022 14:53:55 +0300 Subject: [PATCH] docs(handling): correct grammar --- subjects/handling/README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/subjects/handling/README.md b/subjects/handling/README.md index 1573c262..48edbddb 100644 --- a/subjects/handling/README.md +++ b/subjects/handling/README.md @@ -2,25 +2,18 @@ ### Instructions -Write a **function**, called `open_or_create` which has two arguments: +Create a **function** named `open_or_create` which has two arguments: -- `file : &str` which is the name of the file -- `content: &str` which will be the content to be written into the file +- `file : &str`: which represents a file path. +- `content: &str` which will be the content to be written to the file. -This function should try to open a file, if it does not exist, it should create it. +This function should try to open a file. If it does not exist, the file should be created. In case something goes wrong, it should panic, with the error. -### Notions - -- [Error kind](https://doc.rust-lang.org/std/io/enum.ErrorKind.html) -- [struct file](https://doc.rust-lang.org/std/fs/struct.File.html) -- [OPenOptions](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html) - ### Expected Function ```rust pub fn open_or_create(file: &str, content: &str) { - } ``` @@ -53,3 +46,9 @@ $ cargo run content to be written $ ``` + +### Notions + +- [Error kind](https://doc.rust-lang.org/std/io/enum.ErrorKind.html) +- [struct file](https://doc.rust-lang.org/std/fs/struct.File.html) +- [OPenOptions](https://doc.rust-lang.org/std/fs/struct.OpenOptions.html)