-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get the index of element that was matched by exp_any #14
Comments
I think this is a good idea. Do you have anything in mind? I didn't use rust lately so I don't know if there's any construct which could help here or if the best way forward would be just to create a separate function which would just be for ::Any and would support the new parameter |
honestly I'm still in the beginning of the learning curve of rust, so I may not be the best input for this. @TyPR124 what do you think? You are working on windows support, and this might affect you too. |
To be honest I haven't been looking closely at this part of the code, as I've been focusing mostly on the platform-specific parts and this code is mostly platform-agnostic. That said, I will give it some thought, as it sounds like a good idea. To make sure I'm on the same page here, you're wanting to do something like |
Yep, along with the unread buffer till the match. The matched string have no benefit to me personally, but since it is currently returned I imagine it would be needed too. |
draft of a possible solution to the #14 issue and changes in public interface
find fn returns a tuple with the unread buffer and the matched string by needle. The question is if it could also return the position of the expression used in ReadUntil::Any(vec)? Right now I'm looping through the passed expressions and checking which one matches the returned matched string.
Think "did I match username or password prompt, what to send back to the process".
The text was updated successfully, but these errors were encountered: