Skip to content

Conversation

@cratelyn
Copy link
Member

this golfs down the return expression in
NameRef::try_from_ascii_str().

rather than binding our s to a temporary variable in order to return a Self(s) result, we can take the same result and use Result::map to convert a Result<&'a str, InvalidName> to a
Result<NameRef<'a>, InvalidName>.

this golfs down the return expression in
`NameRef::try_from_ascii_str()`.

rather than binding our `s` to a temporary variable, in order to return
a `Self(s)` result, we can take the same result and use `Result::map` to
convert a `Result<&'a str, InvalidName>` to a
`Result<NameRef<'a>, InvalidName>`.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn marked this pull request as ready for review March 20, 2025 01:52
@cratelyn cratelyn requested a review from a team as a code owner March 20, 2025 01:52
@cratelyn cratelyn enabled auto-merge (squash) March 20, 2025 01:52
@cratelyn cratelyn merged commit 6a5cce8 into main Mar 20, 2025
15 checks passed
@cratelyn cratelyn deleted the kate/golf-linkerd-dns-name-ref-try-from-ascii branch March 20, 2025 19:12
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