Skip to content

Commit

Permalink
chore: change type of module_info field on RenderedDocument to `M…
Browse files Browse the repository at this point in the history
…oduleInfo` (FuelLabs#3846)

Closes FuelLabs#3845
  • Loading branch information
eureka-cpu authored Jan 25, 2023
1 parent e9b6106 commit 1e384ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion forc-plugins/forc-doc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub fn main() -> Result<()> {
// write contents to outfile
for doc in rendered_docs.0 {
let mut doc_path = doc_path.clone();
for prefix in doc.module_info {
for prefix in doc.module_info.0 {
if &prefix != project_name {
doc_path.push(prefix);
}
Expand Down
10 changes: 5 additions & 5 deletions forc-plugins/forc-doc/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) trait Renderable {
}
/// A [Document] rendered to HTML.
pub(crate) struct RenderedDocument {
pub(crate) module_info: Vec<ModulePrefix>,
pub(crate) module_info: ModuleInfo,
pub(crate) html_filename: String,
pub(crate) file_contents: HTMLString,
}
Expand All @@ -42,7 +42,7 @@ impl RenderedDocumentation {
BTreeMap::new();
for doc in raw {
rendered_docs.0.push(RenderedDocument {
module_info: doc.module_info.0.clone(), // fix this
module_info: doc.module_info.clone(),
html_filename: doc.html_filename(),
file_contents: HTMLString::from(doc.clone().render()),
});
Expand Down Expand Up @@ -210,7 +210,7 @@ impl RenderedDocumentation {
// ProjectIndex
match module_map.get(root_module.location()) {
Some(doc_links) => rendered_docs.0.push(RenderedDocument {
module_info: vec![],
module_info: root_module.clone(),
html_filename: INDEX_FILENAME.to_string(),
file_contents: HTMLString::from(
ModuleIndex {
Expand Down Expand Up @@ -239,7 +239,7 @@ impl RenderedDocumentation {
None => panic!("document is empty"),
};
rendered_docs.0.push(RenderedDocument {
module_info: module_info.0.clone(),
module_info: module_info.clone(),
html_filename: INDEX_FILENAME.to_string(),
file_contents: HTMLString::from(
ModuleIndex {
Expand All @@ -258,7 +258,7 @@ impl RenderedDocumentation {

// AllDocIndex
rendered_docs.0.push(RenderedDocument {
module_info: vec![],
module_info: root_module.clone(),
html_filename: ALL_DOC_FILENAME.to_string(),
file_contents: HTMLString::from(
AllDocIndex {
Expand Down

0 comments on commit 1e384ca

Please sign in to comment.