From 9fb95061df70173271b7431000cb8d5ab0ee8957 Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Tue, 29 Oct 2024 21:13:23 +0900 Subject: [PATCH] Update guide sentence and error code snippet --- documentation/docs/error-handling.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/docs/error-handling.md b/documentation/docs/error-handling.md index 82945539..12d79cd1 100644 --- a/documentation/docs/error-handling.md +++ b/documentation/docs/error-handling.md @@ -1,6 +1,6 @@ # Error Handling -Effective error handling is crucial in applications to ensure a smooth user experience and predictable application behavior. +Effective error handling is crucial in applications to ensure predictable application behavior. Rinf expects developers to use Flutter exclusively for the UI layer while keeping all business logic in Rust. This approach encourages handling errors and logging directly in Rust without crossing the language boundary.[^1] @@ -22,9 +22,10 @@ fn not_good() { fn good() -> Result<(), SomeError> { let option = get_option(); - let value_a = option?; + let value_a = option.ok_or(SomeError)?; let result = get_result(); let value_b = result?; + Ok(()) } ```