From ebb1374586cbb3519205e98bcc4645e07c3e2a2a Mon Sep 17 00:00:00 2001 From: tomasavola <108414862+tomasavola@users.noreply.github.com> Date: Mon, 12 Aug 2024 09:55:12 -0300 Subject: [PATCH] Add the code markdown to the Rust types --- docs/docs/detectors/9-avoid-panic-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/detectors/9-avoid-panic-error.md b/docs/docs/detectors/9-avoid-panic-error.md index 721a4a49..125cb86f 100644 --- a/docs/docs/detectors/9-avoid-panic-error.md +++ b/docs/docs/detectors/9-avoid-panic-error.md @@ -9,7 +9,7 @@ The panic! macro is used to stop execution when a condition is not met. This is useful for testing and prototyping, but should be avoided in production code. -Using Result as return type for functions that can fail is the idiomatic way to handle errors in Rust. The Result type is an enum that can be either Ok or Err. The Err variant can contain an error message. The ? operator can be used to propagate the error message to the caller. +Using `Result` as return type for functions that can fail is the idiomatic way to handle errors in Rust. The `Result` type is an enum that can be either `Ok` or `Err`. The `Err` variant can contain an error message. The `?` operator can be used to propagate the error message to the caller. This way, the caller can decide how to handle the error, although the state of the contract is always reverted on the callee.