Skip to content
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

Accept borrowed values in InputWeightPrediction::new() #1672

Merged

Conversation

Harshil-Jani
Copy link
Contributor

The updated implementation accepts borrowed values and now it is convenient to use with slices.

closes #1669

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
Copy link
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

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

ACK f628858

pub fn new<I>(input_script_len: usize, witness_element_lengths: I) -> Self
where I: IntoIterator<Item = usize>,
pub fn new<T>(input_script_len: usize, witness_element_lengths: T) -> Self
where T :IntoIterator, T::Item:Borrow<usize>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't mean to rename the type parameter, I just misremembered it. :) It doesn't matter anyway.

@Kixunil Kixunil added enhancement trivial Obvious, easy and quick to review (few lines or doc-only...) labels Feb 25, 2023
@Kixunil Kixunil added this to the 0.30.0 milestone Feb 25, 2023
@Kixunil Kixunil added the one ack PRs that have one ACK, so one more can progress them label Feb 25, 2023
Copy link
Member

@apoelstra apoelstra left a comment

Choose a reason for hiding this comment

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

ACK f628858

@apoelstra apoelstra merged commit 277eef4 into rust-bitcoin:master Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement one ack PRs that have one ACK, so one more can progress them trivial Obvious, easy and quick to review (few lines or doc-only...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make InputWeightPrediction::new() accept T: IntoIterator, T::Item: Borrow<usize>
3 participants