Only allocate memory if removing text for lesser blocks.
All checks were successful
clippy Build clippy has succeeded
rust-build Build rust-build has succeeded
rust-foreign-document-test Build rust-foreign-document-test has succeeded
rust-test Build rust-test has succeeded

This commit is contained in:
Tom Alexander
2023-10-27 21:28:12 -04:00
parent ee201e1336
commit 816c164996
4 changed files with 35 additions and 14 deletions

View File

@@ -1,3 +1,5 @@
use std::borrow::Cow;
use super::object::Object;
use super::AffiliatedKeywords;
use super::GetAffiliatedKeywords;
@@ -59,7 +61,7 @@ pub struct ExampleBlock<'s> {
pub retain_labels: RetainLabels,
pub use_labels: bool,
pub label_format: Option<&'s str>,
pub contents: String,
pub contents: Cow<'s, str>,
}
#[derive(Debug)]
@@ -68,7 +70,7 @@ pub struct ExportBlock<'s> {
pub affiliated_keywords: AffiliatedKeywords<'s>,
pub export_type: Option<&'s str>,
pub data: Option<&'s str>,
pub contents: String,
pub contents: Cow<'s, str>,
}
#[derive(Debug)]
@@ -83,7 +85,7 @@ pub struct SrcBlock<'s> {
pub retain_labels: RetainLabels,
pub use_labels: bool,
pub label_format: Option<&'s str>,
pub contents: String,
pub contents: Cow<'s, str>,
}
#[derive(Debug)]