nostr:nprofile1qy2hwumn8ghj7un9d3shjtnddaehgu3wwp6kyqpq4cgq353exzmhdsvqjtmw4dq7fvyleuls8umyrvd5umhr4gtx6asqzk33ng that may, in fact, be what I need.

But I'm running into another challenge, I'm going to want the furthest into the string that the parse has failed, and I can't do relative comparisons on Chars objects, just .eq(), so I think I need to additionally track how many characters I think I've read. Sigh.

Reply to this note

Please Login to reply.

Discussion

Ehh you shouldn't need to

Why not use an index instead of counting characters? Or return the index of the failure?

Using '&str' could be useful for easier comparisons too

or even if you have some real complex parsing logic , using a state structure could be useful. Could even create a struct to encapsulate the parser state, including the current index and other info