Skip to content

Commit f89814d

Browse files
committed
feat: Skip some more fields on serialization if optional for source
1 parent 842be0a commit f89814d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/protocol/v7.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ pub struct TemplateInfo {
124124
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq)]
125125
pub struct EmbeddedSources {
126126
/// The sources of the lines leading up to the current line.
127-
#[serde(rename = "pre_context")]
127+
#[serde(rename = "pre_context", skip_serializing_if = "Option::is_none")]
128128
pub pre_lines: Option<Vec<String>>,
129129
/// The current line as source.
130-
#[serde(rename = "context_line")]
130+
#[serde(rename = "context_line", skip_serializing_if = "Option::is_none")]
131131
pub current_line: Option<String>,
132132
/// The sources of the lines after the current line.
133-
#[serde(rename = "post_context")]
133+
#[serde(rename = "post_context", skip_serializing_if = "Option::is_none")]
134134
pub post_lines: Option<Vec<String>>,
135135
}
136136

0 commit comments

Comments
 (0)