Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Consider writing GUIDs as strings in attribute macros #90

Closed
@chris-morgan

Description

#[com_interface(EFF8970E-C50F-45E0-9284-291CE5A6F771)]
pub trait IAnimal: IUnknown {}

This makes me uncomfortable. I’m half-expecting a formatter to reformat the GUID as EFF8970E - C50F -45E0 -9284 -291CE5A6F771 or similar (rustfmt won’t now but could conceivably in the future), and some syntax highlighters will highlight parts of it differently, e.g. “9284” as a number but the rest not. Also, if lower-case hex is used (no idea whether it’s supported in theory or not), then some GUIDs will fail to tokenise, e.g. segments 0bd5 and 1ef3 won’t compile (invalid binary literal and invalid exponent, respectively).

I would prefer the GUID to be a string:

#[com_interface("EFF8970E-C50F-45E0-9284-291CE5A6F771")]
pub trait IAnimal: IUnknown {}

#[com_interface = "…"] would also work.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions