What it does
Personally, I think it would be helpful to have a lint that tells me that a symbol that I am using is available from the core crate, but I am importing it through std.
Categories (optional)
- Kind: probably
clippy::pedantic
What is the advantage of the recommended code over the original code
In embedded development or whenever there may be a reason to have no_std compatibility in one form or another at some point, it is helpful to get an understanding of what is consumed from std, but really coming from core and could be used directly from there (and would not need to be feature gated, replaced, or whatever). Hence, having a lint that could highlight the use of re-exported core symbols through std would be useful, e.g., when no_std support is desirable at some point in the future, but perhaps not implemented right now.
Drawbacks
Not everyone may feel strongly about identifying core functionality as such and, in fact, in a good amount of cases there may not be any benefit to side-stepping std partly. But then it should be an optional feature, similar in nature to print_stdout, for example.
Example
Could be written as:
What it does
Personally, I think it would be helpful to have a lint that tells me that a symbol that I am using is available from the
corecrate, but I am importing it throughstd.Categories (optional)
clippy::pedanticWhat is the advantage of the recommended code over the original code
In embedded development or whenever there may be a reason to have
no_stdcompatibility in one form or another at some point, it is helpful to get an understanding of what is consumed fromstd, but really coming fromcoreand could be used directly from there (and would not need to be feature gated, replaced, or whatever). Hence, having a lint that could highlight the use of re-exportedcoresymbols throughstdwould be useful, e.g., whenno_stdsupport is desirable at some point in the future, but perhaps not implemented right now.Drawbacks
Not everyone may feel strongly about identifying
corefunctionality as such and, in fact, in a good amount of cases there may not be any benefit to side-steppingstdpartly. But then it should be an optional feature, similar in nature toprint_stdout, for example.Example
Could be written as: