Skip to content

Commit

Permalink
feat: Skip some more fields on serialization if optional for source
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko committed Mar 23, 2018
1 parent 842be0a commit f89814d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/protocol/v7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ pub struct TemplateInfo {
#[derive(Serialize, Deserialize, Debug, Default, Clone, PartialEq)]
pub struct EmbeddedSources {
/// The sources of the lines leading up to the current line.
#[serde(rename = "pre_context")]
#[serde(rename = "pre_context", skip_serializing_if = "Option::is_none")]
pub pre_lines: Option<Vec<String>>,
/// The current line as source.
#[serde(rename = "context_line")]
#[serde(rename = "context_line", skip_serializing_if = "Option::is_none")]
pub current_line: Option<String>,
/// The sources of the lines after the current line.
#[serde(rename = "post_context")]
#[serde(rename = "post_context", skip_serializing_if = "Option::is_none")]
pub post_lines: Option<Vec<String>>,
}

Expand Down

0 comments on commit f89814d

Please sign in to comment.