Skip to content

Reimplement Name parsing to support iterating labels, and non-text labels#52

Open
marshallpierce wants to merge 3 commits intotailhook:masterfrom
marshallpierce:mp/ascii
Open

Reimplement Name parsing to support iterating labels, and non-text labels#52
marshallpierce wants to merge 3 commits intotailhook:masterfrom
marshallpierce:mp/ascii

Conversation

@marshallpierce
Copy link

The parser is similar to the previous structure, but re-cast as an Iterator.

Accessing text names is still doable via StrName.

For use cases that need precise label boundaries, iterating over labels (which was always done internally) is now exposed to the caller if they choose.

Fixes #48

I don't claim that rustfmt is always right, but rather that this will
ease future collaboration. Without this, I have to manually format
new code since I can't let the autoformatter do its work.

Based on tailhook#50
documentation = "https://docs.rs/dns-parser"
version = "0.8.0"
authors = ["Paul Colomiets <paul@colomiets.name>"]
edition = "2015"
Copy link
Author

Choose a reason for hiding this comment

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

This is the default value for when the edition is left unspecified

if return_pos.is_none() {
return_pos = Some(pos);
Err(_e) => {
write!(fmt, "<0x{}>", hex::encode(label_bytes))?;
Copy link
Author

Choose a reason for hiding this comment

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

Open to ideas on how better to represent a non-text label in Debug

@marshallpierce
Copy link
Author

Based on #51.

@marshallpierce marshallpierce marked this pull request as ready for review March 17, 2026 20:39
@marshallpierce marshallpierce force-pushed the mp/ascii branch 3 times, most recently from 505f8ef to 27359aa Compare March 17, 2026 22:51
…labels

The parser is similar to the previous structure, but re-cast as an `Iterator`.

Accessing text names is still doable via `StrName`.

For use cases that need precise label boundaries, iterating over labels (which was always done internally) is now exposed to the caller if they choose.
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.

label is not ascii errors with hostnames containing utf8 characters

1 participant