Skip to content

Integrate vendored "utf-8" crate with tendril types#732

Merged
simonwuelker merged 1 commit intoservo:mainfrom
simonwuelker:integrate-utf8
Feb 26, 2026
Merged

Integrate vendored "utf-8" crate with tendril types#732
simonwuelker merged 1 commit intoservo:mainfrom
simonwuelker:integrate-utf8

Conversation

@simonwuelker
Copy link
Contributor

We vendored utf-8 into tendril. tendril in turn defines utf8_decode::IncompleteUtf8 which is a simple wrapper around utf8::Incomplete that adds a few convenience functions. We can merge these two types together for simplicity.

NotEnoughInput,
MalformedUtf8Buffer,
Valid,
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This enum replaces Option<Result<(), ()>> as a return type from try_complete_offsets :P

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
@github-actions github-actions bot added V-breaking Breaking change and removed V-breaking Breaking change labels Feb 26, 2026
@simonwuelker
Copy link
Contributor Author

This is a breaking change because IncompleteUtf8 now implements Copy - I don't think that's a particularly big deal. We don't need to release a new tendril version for this change.

@nicoburns
Copy link
Contributor

This is a breaking change because IncompleteUtf8 now implements Copy - I don't think that's a particularly big deal. We don't need to release a new tendril version for this change.

I don't think adding a trait impl is a breaking change?

Copy link
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

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

Seems reasonable :)

@simonwuelker
Copy link
Contributor Author

simonwuelker commented Feb 26, 2026

This is a breaking change because IncompleteUtf8 now implements Copy - I don't think that's a particularly big deal. We don't need to release a new tendril version for this change.

I don't think adding a trait impl is a breaking change?

cargo semver-checks says it is in this case: A public type now implements Copy, causing non-move closures to capture it by reference instead of moving it.

@simonwuelker simonwuelker added this pull request to the merge queue Feb 26, 2026
Merged via the queue into servo:main with commit 5ba5652 Feb 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

V-breaking Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants