From 4a86a2076b285dd1ddbb17b270356b4f0c90265e Mon Sep 17 00:00:00 2001 From: Varmix Date: Sat, 19 Apr 2025 20:02:42 +0200 Subject: [PATCH] chore: beautful lines --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b17da3f..552a9c2 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,7 @@ local function divideANumberByAnOther(a, b) return a / b -- it would be better to validate parameters, but this is for example purposes end + ------------------------------- -- First scenario: error case ------------------------------- @@ -511,8 +512,6 @@ end -- Output: An error has occured : - - ------------------------------- -- Second scenario: valid case ------------------------------- @@ -527,10 +526,9 @@ end - ----------------------------------- +--------------------------------------------------------------------- -- Third scenario: combine pcall with assert for critical operations ----------------------------------- +--------------------------------------------------------------------- local function readFile(fileName) local fileToRead = assert(io.open(fileName, "r"), "Impossible to read the file") @@ -551,10 +549,9 @@ end - --------------------------------- +----------------------------------------------------------------------- -- Fourth scenario: pcall with a function that returns multiple values --------------------------------------- +----------------------------------------------------------------------- local function sumAndProduct(a, b) return a + b, a * b end