-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
In #70772 I proposed adding BufRead::read_while
. But as @HeroicKatora pointed out in #70772 (comment) Read::take_while
would achieve many of the same benefits with fewer downsides. This would act as a counterpart to Read::take
, similar to Iterator::take_while
.
Examples
let mut param_name = vec![];
source
.by_ref()
.take_while(|b| !matches!(b, b';' | b'='))
.read_to_end(&mut param_name)?;
jam1garner, zslayton and kevinmehall
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.