@@ -10,7 +10,7 @@ use walkdir::{DirEntry, WalkDir};
10
10
11
11
use crate :: { Crate , LINTCHECK_DOWNLOADS , LINTCHECK_SOURCES } ;
12
12
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}" ;
14
14
const DEFAULT_GITHUB_LINK : & str = "{url}/blob/{hash}/src/{file}#L{line}" ;
15
15
const DEFAULT_PATH_LINK : & str = "{path}/src/{file}:{line}" ;
16
16
@@ -39,6 +39,7 @@ struct TomlCrate {
39
39
options : Option < Vec < String > > ,
40
40
/// Magic values:
41
41
/// * `{krate}` will be replaced by `self.name`
42
+ /// * `{krate_}` will be replaced by `self.name` with all `-` replaced by `_`
42
43
/// * `{version}` will be replaced by `self.version`
43
44
/// * `{url}` will be replaced with `self.git_url`
44
45
/// * `{hash}` will be replaced with `self.git_hash`
@@ -55,6 +56,7 @@ impl TomlCrate {
55
56
fn file_link ( & self , default : & str ) -> String {
56
57
let mut link = self . online_link . clone ( ) . unwrap_or_else ( || default. to_string ( ) ) ;
57
58
link = link. replace ( "{krate}" , & self . name ) ;
59
+ link = link. replace ( "{krate_}" , & self . name . replace ( '-' , "_" ) ) ;
58
60
59
61
if let Some ( version) = & self . version {
60
62
link = link. replace ( "{version}" , version) ;
0 commit comments