Skip to content

Commit 125ea35

Browse files
authored
docs: fix formatting and clarify panic documentation (#7111)
1 parent 85f06b9 commit 125ea35

File tree

1 file changed

+2
-2
lines changed
  • docs/reference/src/components/cairo/modules/language_constructs/pages

1 file changed

+2
-2
lines changed

docs/reference/src/components/cairo/modules/language_constructs/pages/panic.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ An example for such a function is `Add` trait `add` function, which is _nopanic_
4141
== `panic_with` macro
4242

4343
A function returning an `Option` or `Result` may be marked with the `panic_with` macro.
44-
This macro takes two arguments, which is the data that is passed as the panic reason as well as the
44+
This macro takes two arguments: the data that is passed as the panic reason as well as the
4545
name for a wrapping function.
4646
If the function returns `None` or `Err`, _panic_ function will be called with the given data.
4747

4848
[source,rust]
4949
----
5050
#[panic_with('got none value', unwrap)]
51-
fn identity(value: Option<u128>) -> Option<u128> { a }
51+
fn identity(value: Option<u128>) -> Option<u128> { value }
5252
----
5353

5454
Some `fn unwrap(value: Option<u128>) -> u128` that internally may panic may be created.

0 commit comments

Comments
 (0)