Skip to content

Disambiguate "byte" size #1673

Closed
Closed
@Rudxain

Description

@Rudxain

The Glossary and "Type Layout" don't specify the size of a "byte".

  • Was that intentional?
  • Is it a real byte? (platform-dependent smallest unit of addressable memory?)
  • Is it guaranteed to be an octet?

I think it's worth being explicit about that.

BTW, the bool reference seems somewhat contradictory:

  • size_of::<bool>() == 1 implies platform-dependent byte
  • The hexadecimal bit-patterns imply u8 (guaranteed octet)

IMO, bytes are more honest and correct than octets (for bool and some enums, at least). For primitives such as char and u8, an exact bit-count is better than bytes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions