简体   繁体   English

我如何识别 rust 文档中的阴影板条箱?

[英]How do I recognize shadowed crates in the rust documentation?

When I document my project by 'cargo doc' then it can happen that the name of my own project shadows a dependend crate which is then invisible.当我通过“cargo doc”记录我的项目时,我自己的项目的名称可能会遮盖一个依赖的板条箱,该板条箱是不可见的。

So I do not see that a crate with the same name exists and this crate then keeps undocumented.所以我没有看到一个同名的板条箱存在,并且这个板条箱没有记录。

How can I tackle this problem?我该如何解决这个问题?

The best workaround is to just avoid this situation from the beginning.最好的解决方法是从一开始就避免这种情况。 Just make sure you're not shadowing any public crates names.只要确保您没有隐藏任何公共板条箱名称即可。 You can check on crates.io if your desired name is available, if it's not I strongly recommend you choose a different name since if you ever want to publish it you'd have to rename it anyways.如果您想要的名称可用,您可以查看crates.io ,如果没有,我强烈建议您选择一个不同的名称,因为如果您想要发布它,您无论如何都必须重命名它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM