I was looking at the std::env::current_dir
documentation and this caught my attention:
std::io::Result<()>
I thought a Result
should have a T
and an E
. How can you substitute them with ()
?
I was looking at the std::env::current_dir
documentation and this caught my attention:
std::io::Result<()>
I thought a Result
should have a T
and an E
. How can you substitute them with ()
?
std::io::Result
is a type alias specific to thestd::io
module, which is defined asEssentially, it's a
std::result::Result
with the error type prefilled as astd::io::Error
. Using this type only requires one type parameter, which corresponds to the "ok" typeT
inResult<T,E>
.