What is Nostr?
Richard Schneeman /
npub1tjf…8266
2024-11-01 17:24:27

Richard Schneeman on Nostr: A thing I do in Ruby is to store a global list of valid options, then when provided a ...

A thing I do in Ruby is to store a global list of valid options, then when provided a value, I iterate or select one from the list. If it's not there I include the valid list in the error output.

> Invalid option "yolo", must be one of: "lol", "rofl", or "lmfao"

I want to do this with Rust, but it's less obvious how in a way that doesn't add a ton of complexity.

#rustlang
Author Public Key
npub1tjf3426t659w7x8yl44z2l948wmslmsp2pnta2gs9tp84r3rpawqfx8266