News for hackers. Stuff that matters.
Re:OpenJDK mailing list: Null-safety and value types by swsieber on Tuesday February 07, 2023 @06:23PM (#34701427)
I rarely if ever use the question mark with 'Option' when working with rust, and it's been just fine.

I do use it a lot with Result though. But if you have any question about the return type you could[1] just look at the return type for the current function you're in.

[1] I think there's a way to define custom types on nightly, and I wouldn't be surprised if it let you map custom types on Result/Option, but I don't actually know.

Re:OpenJDK mailing list: Null-safety and value types by ramranch on Tuesday February 07, 2023 @06:49PM (#34701736)
I am a fan of Rust, but I feel obligated to point out the return type of the current function does not provide any guarantees about the type which '?' was used on, even on stable. Since the generic requirement to use '?' with a return type of `Result<T,E>` is just `Into<E>`, you would still need to look at the called function since `From<E> for T` could be satisfied for (almost) any T.
Re:OpenJDK mailing list: Null-safety and value types by swsieber on Wednesday February 08, 2023 @08:49AM (#34707948)
Ah, I did not realize that. Thanks for pointing that out!