Skip to content

Commit

Permalink
Declare lifetime in From impl (#3329)
Browse files Browse the repository at this point in the history
_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

Signed-off-by: Daniele Ahmed <[email protected]>
  • Loading branch information
82marbag authored Dec 18, 2023
1 parent b829bb4 commit 0d6cf72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ class ServerBuilderGenerator(
private fun renderFromBuilderImpl(writer: RustWriter) {
writer.rustTemplate(
"""
impl #{From}<Builder $lifetime> for #{Structure} $lifetime {
fn from(builder: Builder) -> Self {
impl$lifetime #{From}<Builder $lifetime> for #{Structure} $lifetime {
fn from(builder: Builder$lifetime) -> Self {
builder.build()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ class ServerBuilderGeneratorWithoutPublicConstrainedTypes(
private fun renderFromBuilderImpl(writer: RustWriter) {
writer.rustTemplate(
"""
impl #{From}<Builder $lifetime> for #{Structure}$lifetime {
impl$lifetime #{From}<Builder $lifetime> for #{Structure}$lifetime {
fn from(builder: Builder $lifetime) -> Self {
builder.build()
}
Expand Down

0 comments on commit 0d6cf72

Please sign in to comment.