I found a function with this signature and it confused me:
fn read_uptime() -> Result<u64>. When I read about Result it seemed straight forward. It is an
Enum that returns
Err. As seen here: https://doc.rust-lang.org/std/result/index.html
How can a function return a Result without any mention of the error? I found this example here: https://rust-lang-nursery.github.io/rust-cookbook/errors/handle.html. I've seen it in other places as well out in the wild but I don't understand this example in particular.
When we use the
read_uptime function in main() how can it return anything other than an
i64? I see the match arm for the error but clearly we don't have an error in the function signature.