Lesley Lai on Nostr: #rust question: do you consider returning a `Result<Option<SOmething>, SomeError>` ...
#rust question: do you consider returning a `Result<Option<SOmething>, SomeError>` anti-pattern? Should I just flatten it into `Result<Something, SomeError>`? The previous approach works great with question marks
#rustlang
Published at
2024-05-22 08:56:31Event JSON
{
"id": "da4ccf8ca15630f27c9a87d8cedd39ea8d58605ba494d584c27a1b5af50fb51f",
"pubkey": "fe6ce64037b7f036ab41abe9ef80e1b096380c361871c2c2cc4da7a98e12f9f0",
"created_at": 1716368191,
"kind": 1,
"tags": [
[
"t",
"rust"
],
[
"t",
"rustlang"
],
[
"proxy",
"https://mastodon.gamedev.place/users/lesley/statuses/112483905823885485",
"activitypub"
]
],
"content": "#rust question: do you consider returning a `Result\u003cOption\u003cSOmething\u003e, SomeError\u003e` anti-pattern? Should I just flatten it into `Result\u003cSomething, SomeError\u003e`? The previous approach works great with question marks\n\n #rustlang",
"sig": "c99dd98a7a92766ede1c70d7282b02971be6ecfb3dadd6881fb4b58f4084cfea08ea045d58580b73afc0d01f7bcc3396f13729896e59b8c970c1a38736a9361b"
}