What is Nostr?
Richard Schneeman /
npub1tjf…8266
2024-11-01 20:19:29
in reply to nevent1q…kzk7

Richard Schneeman on Nostr: So far my options are: - Write a proc macro that tries to reverse engineer the format ...

So far my options are:

- Write a proc macro that tries to reverse engineer the format and generate the literal code tokens suggested above.

Would work, but overly coupled and might diverge from format! features in the future. Non trivial implementation investment.

- Use a const macro to replace the format string literal.

Pretty hacky, doesn't handle case where `fn custom_fmt` needs to do more logic. Even handling curly escapes might be elusive.

- Any other ideas?
Author Public Key
npub1tjf3426t659w7x8yl44z2l948wmslmsp2pnta2gs9tp84r3rpawqfx8266