Comment on Go vs. Rust: Writing a CLI ToolparentComments−pkolaczk6yIt doesn't only WARN about ignoring an error, it refuses to compile. T and Result<T, E> are different types.−kd5bjo6yThe warning comes if you try to call a function for its side effects and ignore the return value. In most cases it’s fine, but ignoring a Result or a Future will issue a warning.−saturn_vk6yI've always wondered whether "unwrap"-ing is considered ignoring? I personally always equated it to ignoring if there's an error−steveklabnik6yI would say no, because it's not ignored. It makes it explode.
Comments
It doesn't only WARN about ignoring an error, it refuses to compile. T and Result<T, E> are different types.
The warning comes if you try to call a function for its side effects and ignore the return value. In most cases it’s fine, but ignoring a Result or a Future will issue a warning.
I've always wondered whether "unwrap"-ing is considered ignoring? I personally always equated it to ignoring if there's an error
I would say no, because it's not ignored. It makes it explode.