Only allocate memory if removing text for lesser blocks.
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user