@@ -10,7 +10,7 @@ use walkdir::{DirEntry, WalkDir};
1010
1111use crate :: { Crate , LINTCHECK_DOWNLOADS , LINTCHECK_SOURCES } ;
1212
13- const DEFAULT_DOCS_LINK : & str = "https://docs.rs/{krate}/{version}/src/{krate }/{file}.html#{line}" ;
13+ const DEFAULT_DOCS_LINK : & str = "https://docs.rs/{krate}/{version}/src/{krate_ }/{file}.html#{line}" ;
1414const DEFAULT_GITHUB_LINK : & str = "{url}/blob/{hash}/src/{file}#L{line}" ;
1515const DEFAULT_PATH_LINK : & str = "{path}/src/{file}:{line}" ;
1616
@@ -39,6 +39,7 @@ struct TomlCrate {
3939 options : Option < Vec < String > > ,
4040 /// Magic values:
4141 /// * `{krate}` will be replaced by `self.name`
42+ /// * `{krate_}` will be replaced by `self.name` with all `-` replaced by `_`
4243 /// * `{version}` will be replaced by `self.version`
4344 /// * `{url}` will be replaced with `self.git_url`
4445 /// * `{hash}` will be replaced with `self.git_hash`
@@ -55,6 +56,7 @@ impl TomlCrate {
5556 fn file_link ( & self , default : & str ) -> String {
5657 let mut link = self . online_link . clone ( ) . unwrap_or_else ( || default. to_string ( ) ) ;
5758 link = link. replace ( "{krate}" , & self . name ) ;
59+ link = link. replace ( "{krate_}" , & self . name . replace ( '-' , "_" ) ) ;
5860
5961 if let Some ( version) = & self . version {
6062 link = link. replace ( "{version}" , version) ;
0 commit comments