8000 Extract the Script assembly creator from fmt::Debug by stevenroose · Pull Request #203 · rust-bitcoin/rust-bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extract the Script assembly creator from fmt::Debug #203

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

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

stevenroose
Copy link
Collaborator

Exposes a method to get the assembly string without the Script( ... ) wrapper.

I would personally also remove the wrapper from fmt::Display, but that's subject to opinion. With this, nothing changes, just the method to get the unwrapped string.

}

/// Get the assembly decoding of the script.
pub fn asm(&self) -> String {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

asm_string() perhaps if this is confusing?

@stevenroose stevenroose requested review from apoelstra and tamasblummer and removed request for apoelstra January 22, 2019 19:58
@dongcarl
Copy link
Member
dongcarl commented Feb 7, 2019

@stevenroose Could you implement this by taking in a Write? Makes things more general and less allocation overhead.

@stevenroose
Copy link
Collaborator Author

@dongcarl It already is: https://github.com/rust-bitcoin/rust-bitcoin/pull/203/files#diff-358dc6da5fefadffc19f9382ebd4f57bR341

I don't think an io::Write makes more sense as it's a string, not bytes.

@dongcarl dongcarl merged commit 560dfb7 into rust-bitcoin:master Feb 11, 2019
yancyribbens pushed a commit to yancyribbens/rust-bitcoin that referenced this pull request Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0