From d83bce9ce32006ad17438abe96f2c3f20a3e5caa Mon Sep 17 00:00:00 2001 From: dlloyd1 Date: Mon, 9 Dec 2024 17:28:41 +0000 Subject: [PATCH] Typo fix (#62) --- challenges/graceful-error-handling/description.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/challenges/graceful-error-handling/description.md b/challenges/graceful-error-handling/description.md index 2e849a5..78b1193 100644 --- a/challenges/graceful-error-handling/description.md +++ b/challenges/graceful-error-handling/description.md @@ -6,7 +6,7 @@ When you have a function that can fail, you can use the `Result` type to return ## Your task -In this challenges, you're given a function, `parse_percentage(input: &str) -> Result` that takes a string as input and returns a `Result` type. The function should parse the input string as a percentage and return the percentage as a `u8` if the input is valid. If the input is invalid, the function should return an error message as a `String`. +In this challenge, you're given a function, `parse_percentage(input: &str) -> Result` that takes a string as input and returns a `Result` type. The function should parse the input string as a percentage and return the percentage as a `u8` if the input is valid. If the input is invalid, the function should return an error message as a `String`. Parsing from a string to a number can fail for many reasons. For example, the input string may not be a valid number, or it may be a valid number but not a valid percentage. Your task is to handle these errors gracefully and return an error message that explains what went wrong.