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

Add convenience finish_output method #1355

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bee-message/src/output/alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ impl AliasOutputBuilder {

Ok(output)
}

/// Finishes the [`AliasOutputBuilder`] into an [`Output`].
pub fn finish_output(self) -> Result<Output, Error> {
Ok(Output::Alias(self.finish()?))
}
}

impl From<&AliasOutput> for AliasOutputBuilder {
Expand Down
5 changes: 5 additions & 0 deletions bee-message/src/output/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ impl BasicOutputBuilder {

Ok(output)
}

/// Finishes the [`BasicOutputBuilder`] into an [`Output`].
pub fn finish_output(self) -> Result<Output, Error> {
Ok(Output::Basic(self.finish()?))
}
}

impl From<&BasicOutput> for BasicOutputBuilder {
Expand Down
5 changes: 5 additions & 0 deletions bee-message/src/output/foundry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ impl FoundryOutputBuilder {

Ok(output)
}

/// Finishes the [`FoundryOutputBuilder`] into an [`Output`].
pub fn finish_output(self) -> Result<Output, Error> {
Ok(Output::Foundry(self.finish()?))
}
}

impl From<&FoundryOutput> for FoundryOutputBuilder {
Expand Down
5 changes: 5 additions & 0 deletions bee-message/src/output/nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ impl NftOutputBuilder {

Ok(output)
}

/// Finishes the [`NftOutputBuilder`] into an [`Output`].
pub fn finish_output(self) -> Result<Output, Error> {
Ok(Output::Nft(self.finish()?))
}
}

impl From<&NftOutput> for NftOutputBuilder {
Expand Down