Skip to content

Commit

Permalink
fix(contributors): support missing contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Nov 26, 2024
1 parent 5207886 commit d408b52
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions crates/rari-doc/src/contributors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ use std::collections::HashMap;
use rari_types::locale::Locale;
use serde::Deserialize;

#[derive(Clone, Debug, Deserialize)]
#[derive(Clone, Debug, Default, Deserialize)]
pub struct WikiHistoryEntry {
#[serde(default)]
pub contributors: Vec<String>,
}

Expand Down Expand Up @@ -69,11 +70,13 @@ pub fn contributors_txt(wiki_history: Option<&WikiHistoryEntry>, github_file_url
"\n\n",
]);
if let Some(wh) = wiki_history {
out.extend([
"# Original Wiki contributors\n",
&wh.contributors.join("\n"),
"\n",
]);
if !wh.contributors.is_empty() {
out.extend([
"# Original Wiki contributors\n",
&wh.contributors.join("\n"),
"\n",
]);
}
}
out
}

0 comments on commit d408b52

Please sign in to comment.