Replace - with _ in crate lookup

rustdoc normalizes the name of a crate by replacing hyphens with
underscores.  With this patch, we also perform this normalization when
looking up a crate.
This commit is contained in:
Robin Krahl 2020-07-24 12:17:17 +02:00
parent fc7d2c7ee9
commit ec6be9fbb1
No known key found for this signature in database
GPG Key ID: 8E9B0870524F69D8

View File

@ -35,7 +35,7 @@ impl DirSource {
impl Source for DirSource {
fn find_crate(&self, name: &str) -> Option<doc::Crate> {
let crate_path = self.path.join(name);
let crate_path = self.path.join(name.replace('-', "_"));
if crate_path.join("all.html").is_file() {
Some(doc::Crate::new(name.to_owned(), crate_path))
} else {