Skip to content

feat: allow getting Host's inner Authority value - #238

Merged
seanmonstar merged 2 commits into
hyperium:masterfrom
wfraser:patch-1
Oct 1, 2026
Merged

seanmonstar merged 2 commits into
hyperium:masterfrom
wfraser:patch-1

Conversation

@wfraser

@wfraser wfraser commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

If I have a Host, and need an Authority, right now I have to do Authority::from_str(&host.to_string()) which involves an extra unnecessary string allocation and parse.

(The clone here is a cheap refcount increment because Authority is backed by a Bytes.)

If I have a `Host`, and need an `Authority`, right now I have to do `Authority::from_str(&host.to_string())` which involves an extra  unnecessary string allocation and parse.
@seanmonstar

Copy link
Copy Markdown
Member

Oh yea, fair point! How about instead offing a From<Host> for Authority impl in here. That feels more idiomatic.

@wfraser

wfraser commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

Done. Let me know if you're not a fan of that formal args destructuring syntax.

@seanmonstar seanmonstar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@seanmonstar
seanmonstar merged commit 6a091bf into hyperium:master Oct 1, 2026
6 checks passed
@wfraser
wfraser deleted the patch-1 branch October 2, 2026 05:01
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.

2 participants