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::Resultis a type alias specific to thestd::iomodule, which is defined asEssentially, it's a
std::result::Resultwith the error type prefilled as astd::io::Error. Using this type only requires one type parameter, which corresponds to the "ok" typeTinResult<T,E>.