Returns Option>

⚓ Rust    📅 2025-10-31    👤 surdeus    👁️ 7      

surdeus

Warning

This post was published 31 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Returns Option>

In the last two years, I sometimes saw functions having the return type Option<Vec>. I know that Rust is proud to have the option type, and often its use makes sense. But when the return type is a vector, it can be empty, which is in principle already some form of NONE. So why put an Option on top?

11 posts - 5 participants

Read full topic

🏷️ Rust_feed