Skip to content

Commit d408b52

Browse files
committed
fix(contributors): support missing contributors
1 parent 5207886 commit d408b52

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

crates/rari-doc/src/contributors.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ use std::collections::HashMap;
33
use rari_types::locale::Locale;
44
use serde::Deserialize;
55

6-
#[derive(Clone, Debug, Deserialize)]
6+
#[derive(Clone, Debug, Default, Deserialize)]
77
pub struct WikiHistoryEntry {
8+
#[serde(default)]
89
pub contributors: Vec<String>,
910
}
1011

@@ -69,11 +70,13 @@ pub fn contributors_txt(wiki_history: Option<&WikiHistoryEntry>, github_file_url
6970
"\n\n",
7071
]);
7172
if let Some(wh) = wiki_history {
72-
out.extend([
73-
"# Original Wiki contributors\n",
74-
&wh.contributors.join("\n"),
75-
"\n",
76-
]);
73+
if !wh.contributors.is_empty() {
74+
out.extend([
75+
"# Original Wiki contributors\n",
76+
&wh.contributors.join("\n"),
77+
"\n",
78+
]);
79+
}
7780
}
7881
out
7982
}

0 commit comments

Comments
 (0)