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

Improve const generated docs #426

Open
DJDuque opened this issue Jul 19, 2023 · 1 comment
Open

Improve const generated docs #426

DJDuque opened this issue Jul 19, 2023 · 1 comment

Comments

@DJDuque
Copy link

DJDuque commented Jul 19, 2023

I am not sure if this is even possible at the library level. If it is not, feel free to close this issue.

Issue

If you are writing a library and you have something like:

pub const MY_LENGTH: f64 = 1.0 * 5.0

this will generate documentation using cargo doc like:

pub const MY_LENGTH: f64= _; // 5f64

If you are using uom to have a constant length like:

pub const MY_LENGTH: Length = Length {
    dimension: PhantomData,
    units: PhantomData,
    value: 5.0,
};

this will generate documentation like:

pub const MY_LENGTH: Length;

Suggestion

It would be great if the generated doc had an extra comment line to show what the numeric value of the constant is. Something like:

pub const MY_LENGTH: Length; // 5f64 meters

Or anything along those lines.

@iliekturtles
Copy link
Owner

Are you referring to output generated by cargo doc? If so that's not something a library can control and you'd need to look into reporting the issue there.

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

2 participants