I am student of Algorithmic Computer Science at Wrocław University of Science and Technology. Current goal is to became a cybersecurity expert.
- Wrocław
Highlights
- Pro
Pinned Loading
-
-
-
What does ? mean exactly in rust
What does ? mean exactly in rust 1# What does `?` exactly mean in rust language2## Obvious usage3When learning rust, we will for sure encounter [`Option`](https://doc.rust-lang.org/std/option/index.html) and [`Result`](https://doc.rust-lang.org/std/result/index.html) types as a one way of error handling in rust. One of the core principle[^1] of them is that. If you can not deal with an error, return `Err` or `None` to code that called you. And so on, error are sent to higher function until one of them can do something with that, where on top is main function that can either ask a user to try again or end program here and there. As great as it sound it has a problem, it will end up in lot of boilerplate.
4```rust
5fn foo(x: u16) -> Option<u16> {
-
-
-
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.
