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

Derive opcode_length instead of setting it explicitly #805

Open
zslayton opened this issue Aug 11, 2024 · 1 comment
Open

Derive opcode_length instead of setting it explicitly #805

zslayton opened this issue Aug 11, 2024 · 1 comment

Comments

@zslayton
Copy link
Contributor

          Can this be derived (i.e. `fn is_tagless() -> bool`) rather than storing the opcode length in a field? Tagless encodings _must_ have `value_body_length + length_length == total_length`, and anything else _must_ have an opcode, so `value_body_length + length_length < total_length` is always true for anything that is not a tagless encoded argument. Right?

Originally posted by @popematt in #801 (comment)

@zslayton
Copy link
Contributor Author

Also look into addressing this comment:

Perhaps Header should actually be an enum so that it could have a NoHeader variant in addition to whatever other implementations you have going on?

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

No branches or pull requests

1 participant