Do not clone ancestors when serializing
This commit is contained in:
parent
fe79798b0f
commit
c38d9e56c8
|
@ -69,7 +69,7 @@ pub struct SerializingPage<'a> {
|
||||||
content: &'a str,
|
content: &'a str,
|
||||||
permalink: &'a str,
|
permalink: &'a str,
|
||||||
slug: &'a str,
|
slug: &'a str,
|
||||||
ancestors: Vec<String>,
|
ancestors: Vec<&'a str>,
|
||||||
title: &'a Option<String>,
|
title: &'a Option<String>,
|
||||||
description: &'a Option<String>,
|
description: &'a Option<String>,
|
||||||
updated: &'a Option<String>,
|
updated: &'a Option<String>,
|
||||||
|
@ -138,7 +138,7 @@ impl<'a> SerializingPage<'a> {
|
||||||
let ancestors = page
|
let ancestors = page
|
||||||
.ancestors
|
.ancestors
|
||||||
.iter()
|
.iter()
|
||||||
.map(|k| library.get_section_by_key(*k).file.relative.clone())
|
.map(|k| library.get_section_by_key(*k).file.relative.as_str())
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let translations = TranslatedContent::find_all_pages(page, library);
|
let translations = TranslatedContent::find_all_pages(page, library);
|
||||||
|
@ -197,7 +197,7 @@ impl<'a> SerializingPage<'a> {
|
||||||
let ancestors = if let Some(ref lib) = library {
|
let ancestors = if let Some(ref lib) = library {
|
||||||
page.ancestors
|
page.ancestors
|
||||||
.iter()
|
.iter()
|
||||||
.map(|k| lib.get_section_by_key(*k).file.relative.clone())
|
.map(|k| lib.get_section_by_key(*k).file.relative.as_str())
|
||||||
.collect()
|
.collect()
|
||||||
} else {
|
} else {
|
||||||
vec![]
|
vec![]
|
||||||
|
@ -251,7 +251,7 @@ pub struct SerializingSection<'a> {
|
||||||
relative_path: &'a str,
|
relative_path: &'a str,
|
||||||
content: &'a str,
|
content: &'a str,
|
||||||
permalink: &'a str,
|
permalink: &'a str,
|
||||||
ancestors: Vec<String>,
|
ancestors: Vec<&'a str>,
|
||||||
title: &'a Option<String>,
|
title: &'a Option<String>,
|
||||||
description: &'a Option<String>,
|
description: &'a Option<String>,
|
||||||
extra: &'a Map<String, Value>,
|
extra: &'a Map<String, Value>,
|
||||||
|
@ -283,7 +283,7 @@ impl<'a> SerializingSection<'a> {
|
||||||
let ancestors = section
|
let ancestors = section
|
||||||
.ancestors
|
.ancestors
|
||||||
.iter()
|
.iter()
|
||||||
.map(|k| library.get_section_by_key(*k).file.relative.clone())
|
.map(|k| library.get_section_by_key(*k).file.relative.as_str())
|
||||||
.collect();
|
.collect();
|
||||||
let translations = TranslatedContent::find_all_sections(section, library);
|
let translations = TranslatedContent::find_all_sections(section, library);
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ impl<'a> SerializingSection<'a> {
|
||||||
ancestors = section
|
ancestors = section
|
||||||
.ancestors
|
.ancestors
|
||||||
.iter()
|
.iter()
|
||||||
.map(|k| lib.get_section_by_key(*k).file.relative.clone())
|
.map(|k| lib.get_section_by_key(*k).file.relative.as_str())
|
||||||
.collect();
|
.collect();
|
||||||
translations = TranslatedContent::find_all_sections(section, lib);
|
translations = TranslatedContent::find_all_sections(section, lib);
|
||||||
subsections =
|
subsections =
|
||||||
|
|
Loading…
Reference in a new issue