Oh that was fast thank you!
Yes i looked at it last weekend in the rust book and forgot it directly. Thanks for taking time i will read this chapter again!
For the assembly i just used the website godbolt.org:
Compiler Explorer
Not sure how good the assembly looks here.
Compiler: rustc 1.84.0
<&i32 as core::ops::arith::Add<&i32>>::add::hf4e8167fde4f863c:
sub rsp, 40
mov qword ptr [rsp], rdx
mov qword ptr [rsp + 16], rdi
mov qword ptr [rsp + 24], rsi
mov eax, dword ptr [rdi]
mov dword ptr [rsp + 32], eax
mov ecx, dword ptr [rsi]
mov dword ptr [rsp + 36], ecx
add eax, ecx
mov dword ptr [rsp + 12], eax
seto al
jo .LBB0_2
mov eax, dword ptr [rsp + 12]
add rsp, 40
ret
.LBB0_2:
mov rdi, qword ptr [rsp]
mov rax, qword ptr [rip + core::panicking::panic_const::panic_const_add_overflow::h5a5f82b06563d133@GOTPCREL]
call rax
f1:
sub rsp, 24
mov dword ptr [rsp + 12], 22
mov dword ptr [rsp + 16], 11
mov eax, 11
add eax, 22
mov dword ptr [rsp + 8], eax
seto al
jo .LBB1_2
mov eax, dword ptr [rsp + 8]
mov dword ptr [rsp + 20], eax
add rsp, 24
ret
.LBB1_2:
lea rdi, [rip + .L__unnamed_1]
mov rax, qword ptr [rip + core::panicking::panic_const::panic_const_add_overflow::h5a5f82b06563d133@GOTPCREL]
call rax
f2:
sub rsp, 24
mov dword ptr [rsp + 12], 11
mov dword ptr [rsp + 16], 22
lea rdi, [rsp + 12]
lea rsi, [rsp + 16]
lea rdx, [rip + .L__unnamed_2]
call <&i32 as core::ops::arith::Add<&i32>>::add::hf4e8167fde4f863c
mov dword ptr [rsp + 20], eax
add rsp, 24
ret
.L__unnamed_3:
.ascii "/app/example.rs"
.L__unnamed_1:
.quad .L__unnamed_3
.asciz "\017\000\000\000\000\000\000\000\016\000\000\000\023\000\000"
.L__unnamed_2:
.quad .L__unnamed_3
.asciz "\017\000\000\000\000\000\000\000\027\000\000\000\023\000\000"
some mention about which way is the better way to write clean code?