Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Convenience methods to create URL authority from its parts

未关闭
#458 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust
领域
api, networking

调研方向

首先定位 Authority 解析的实现,以及现有的构造或解析测试。检查当前如何转换主机和端口对,包括 IPv6 的处理。完成后,应提供一种有文档说明的便捷转换方式,能够从分开的主机和端口值进行转换,而不要求调用方自行格式化 Authority 字符串。

由索引模型根据 Issue 内容生成。

描述

Currently, the only way to build an Authority object is to parse a string in the form <host>:<port>. This can be a bit inconvenient: In the case the host is an ipv6 address, it needs to be enclosed in [], and the developer will have to do a somewhat complex dance to go from a Host/Port pair to a proper authority string.

It'd be nice to have additional convenience methods, e.g.

// From a host and a port
impl TryFrom<(&str, u16)> for Authority {}

This way, if &str is an IPv6 address (which can be detected by trying to parse it with Ipv6Addr::parse), it can automatically be bracketed.

主要语言
Rust
星标
1.4k
派生
385
平均合并
1 天 5 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

hyperium/http 的其他 Issue

查看 hyperium/http 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。