Rust: Add an ignore function to Result to explicitly ignore it.

Created on 11 Jan 2015  路  6Comments  路  Source: rust-lang/rust

Most helpful comment

I don't know why this thread was closed. The comment in the PR doesn't say there definitely needs to be an RFC and it doesn't indicate this is resolved in any way, just that there needs to be further discussion.

All 6 comments

Seems reasonable to me.

I use .ok(); to do that. I guess that's pretty obscure code.

Closing for reasons cited in the PR: https://github.com/rust-lang/rust/pull/21101#issuecomment-69815321

Is this still potentially on the table for a future release? Seems like a useful method for Result to have.

I don't know why this thread was closed. The comment in the PR doesn't say there definitely needs to be an RFC and it doesn't indicate this is resolved in any way, just that there needs to be further discussion.

Nim uses a discard statement for this effect: https://nim-lang.org/docs/tut1.html#procedures-discard-statement

Was this page helpful?
0 / 5 - 0 ratings