Skip to content

Conversation

0xForerunner
Copy link

@0xForerunner 0xForerunner commented Nov 19, 2022

@ehuss ehuss added the T-libs-api Relevant to the library API team, which will review and decide on the RFC. label Nov 19, 2022
@ehuss
Copy link
Contributor

ehuss commented Nov 19, 2022

Just FYI, I think most standard library additions go through the API Change Proposal process. I'm reluctant to speak for the libs-api team, but I think that is the process they typically use for a change like this.

@CryZe
Copy link

CryZe commented Nov 19, 2022

I feel like this API is too overloaded. It's essentially just filter / filter_map + collecting into an array, with the former being stable APIs and the latter having lots of unresolved questions which would all apply to this API as well.

@0xForerunner
Copy link
Author

0xForerunner commented Nov 19, 2022 via email

@0xForerunner
Copy link
Author

Just FYI, I think most standard library additions go through the API Change Proposal process. I'm reluctant to speak for the libs-api team, but I think that is the process they typically use for a change like this.

Entirely poissible. This is my first contribution here so I may have got the process wrong. It seemed like this was the right place based off of The contribution book.

@dlight
Copy link

dlight commented Nov 20, 2022

Link to cuviper's comment on IRLO, and ewoolsey's comment that introduced those functions.

I think they are well motivated but would work better as methods.

@0xForerunner
Copy link
Author

I think they are well motivated but would work better as methods.

Oh yeah perhaps I should have been more clear in this RFC. The intention 100% would be to implement them as methods.

```rust
let mut v = vec![(0, 1), (1, 2), (2, 3), (3, 4), (4, 5)];
let [left, right] =
v.find_map_many(&mut v, [&2, &3], |item, key| &item.0 == key, |item| &mut item.1).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Borrowing v and &mut v at the same time?

@ahicks92

This comment was marked as resolved.

@0xForerunner
Copy link
Author

So where do things go from here? I would love to move forward with this if possible. So far it seems like the only complaint is that the api is a bit chunky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the RFC.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants