You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we add a note in the Issue description mentioning we should remove allocations from the current implementation? Not necessarily a blocker to stabilizing, mostly to document the discussion we had in #71780
Would it be possible to start an FCP for stabilising this feature? As long as we're happy with the public API, optimising the implementation to reduce/remove allocations can be done post-stabilisation.
Would it be possible to start an FCP for stabilising this feature? As long as we're happy with the public API
According to the discussion in #71780, the current API is considered too restrictive. Improving it would depend on redesigning the Pattern API, so this probably won't be stabilized anytime soon.
Hi, novice here. I have read the discussion in (#71780) and understand that the current API has memory allocation and they want to remove HRTB.
I'm curious: why not just design the current API to yield back strings that don't have the same pattern if we really don't want memory allocation, thus simplifying ownership and borrowing?
Edit:
After further analysis, I found that the current remove_matches API is challenging to stabilize since it uses another unstable function, as discussed in this discussion (#27721)
Another thing is that it is much easier to avoid memory allocation when manipulating &str compared to String, since String is a heap-allocated data structure. Thus, developing memory-efficient functions for different types is challenging.
I think we probably need to make a separate function to remove patterns from strings, especially for the String type where optimization is needed.
Activity
frewsxcv commentedon Mar 5, 2021
Can we add a note in the Issue description mentioning we should remove allocations from the current implementation? Not necessarily a blocker to stabilizing, mostly to document the discussion we had in #71780
sciguy16 commentedon Nov 7, 2022
Would it be possible to start an FCP for stabilising this feature? As long as we're happy with the public API, optimising the implementation to reduce/remove allocations can be done post-stabilisation.
andylizi commentedon Nov 7, 2022
According to the discussion in #71780, the current API is considered too restrictive. Improving it would depend on redesigning the Pattern API, so this probably won't be stabilized anytime soon.
allaboutevemirolive commentedon Jul 26, 2023
Hi, novice here. I have read the discussion in (#71780) and understand that the current API has memory allocation and they want to remove HRTB.
I'm curious: why not just design the current API to yield back strings that don't have the same pattern if we really don't want memory allocation, thus simplifying ownership and borrowing?
Edit:
After further analysis, I found that the current
remove_matchesAPI is challenging to stabilize since it uses another unstable function, as discussed in this discussion (#27721)Another thing is that it is much easier to avoid memory allocation when manipulating
&strcompared toString, sinceStringis a heap-allocated data structure. Thus, developing memory-efficient functions for different types is challenging.I think we probably need to make a separate function to remove patterns from strings, especially for the
Stringtype where optimization is needed.axeld-galadrim commentedon Mar 18, 2024
The main PR has been merged a few months ago.
Is it planned to move this feature as not experimental anytime soon ?