Fix double slashes in docs links (#3675)

This commit is contained in:
Laurenz 2024-03-15 11:49:20 +01:00 committed by GitHub
parent 98052890a7
commit 906637dacb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,10 +87,10 @@ fn resolve_definition(head: &str, base: &str) -> StrResult<String> {
return Ok(route);
}
let mut route = format!("{}reference/{}/{name}/", base, category.name());
let mut route = format!("{}reference/{}/{name}", base, category.name());
if let Some(next) = parts.next() {
if let Ok(field) = value.field(next) {
route.push_str("#definitions-");
route.push_str("/#definitions-");
route.push_str(next);
if let Some(next) = parts.next() {
if field.cast::<Func>().is_ok_and(|func| func.param(next).is_some()) {
@ -103,7 +103,7 @@ fn resolve_definition(head: &str, base: &str) -> StrResult<String> {
.cast::<Func>()
.is_ok_and(|func| func.param(next).is_some())
{
route.push_str("#parameters-");
route.push_str("/#parameters-");
route.push_str(next);
} else {
bail!("field {next} not found");