Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Rename deserialize_unchecked to deserializes_ignnore_signature #1213

Open
TTWNO opened this issue Jan 10, 2025 · 2 comments
Open

RFC: Rename deserialize_unchecked to deserializes_ignnore_signature #1213

TTWNO opened this issue Jan 10, 2025 · 2 comments

Comments

@TTWNO
Copy link
Contributor

TTWNO commented Jan 10, 2025

Most _unchecked_ affixed functions in the standard library: unchecked_add or from_utf8_unchecked for example have "unchecked" to mean "there are safety conditions that must be met for this to not cause undefined behaviour".

However, in zbus it is used to mean "deserialzie this, I've checked the body signature already". And while I understand the meaning, it is a bit confusing for outsiders to zbus (or atspi) to see the _unchecked suffix when in zbus you will merely get an error (perhaps a confusing one) if you deserialize to the wrong signature.

My proposed new name is deserialize_ignore_signature.

Thoughts?

@zeenix zeenix changed the title [6.x]: Rename deserialize_unchecked to deserializes_ignnore_signature RFC: Rename deserialize_unchecked to deserializes_ignnore_signature Jan 10, 2025
@zeenix
Copy link
Contributor

zeenix commented Jan 10, 2025

Sure and you can already do this by keeping around the old method as a deprecated wrapper.

@zeenix
Copy link
Contributor

zeenix commented Jan 10, 2025

I really don't thing this is a biggie though. The API is low-level and most folks won't use it and even if they do, the docs tell you what it means. Perhaps the docs can be made clearer and then this isn't really needed? If you still feel strongly about it, then you'd have to propose a better name (clearer but not super long/verbose either). :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants