Skip to content

Commit

Permalink
more = removal
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Oct 5, 2024
1 parent d2fb99b commit 71d80a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 1 addition & 6 deletions src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,11 @@ impl Display for KdlEntry {
write!(f, "{}", name)?;
if let Some(KdlEntryFormat {
after_key,
eq,
after_eq,
..
}) = &self.format
{
write!(f, "{}{}{}", after_key, eq, after_eq)?;
write!(f, "{}={}", after_key, after_eq)?;
} else {
write!(f, "=")?;
}
Expand Down Expand Up @@ -271,8 +270,6 @@ pub struct KdlEntryFormat {
pub after_key: String,
/// Whitespace and comments between an entry's equals sign and its value.
pub after_eq: String,
/// Actual text used as an entry's equals sign.
pub eq: String,
}

#[cfg(test)]
Expand Down Expand Up @@ -346,7 +343,6 @@ mod test {
name: Some("foo".parse()?),
format: Some(KdlEntryFormat {
value_repr: "bar".into(),
eq: "=".into(),
..Default::default()
}),
#[cfg(feature = "span")]
Expand Down Expand Up @@ -387,7 +383,6 @@ mod test {
after_ty: "".into(),
after_key: "".into(),
after_eq: "".into(),
eq: "=".into(),
}),
ty: Some("\"m\\\"eh\"".parse()?),
value: KdlValue::Integer(0xdeadbeef),
Expand Down
4 changes: 1 addition & 3 deletions src/v2_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@ fn entry_test() {
name: Some("foo".parse().unwrap()),
format: Some(KdlEntryFormat {
value_repr: "bar".into(),
eq: "=".into(),
..Default::default()
}),
span: (0..7).into()
Expand Down Expand Up @@ -466,7 +465,7 @@ fn node_terminator(input: &mut Input<'_>) -> PResult<()> {

/// `prop := string optional-node-space equals-sign optional-node-space value`
fn prop(input: &mut Input<'_>) -> PResult<Option<KdlEntry>> {
let ((key, after_key, eq, after_eq, value), _span) = (
let ((key, after_key, _eqa, after_eq, value), _span) = (
identifier,
optional_node_space.take(),
equals_sign.take(),
Expand All @@ -479,7 +478,6 @@ fn prop(input: &mut Input<'_>) -> PResult<Option<KdlEntry>> {
value.name = Some(key);
if let Some(fmt) = value.format_mut() {
fmt.after_ty = after_key.into();
fmt.eq = eq.into();
fmt.after_eq = after_eq.into();
}
#[cfg(feature = "span")]
Expand Down

0 comments on commit 71d80a5

Please sign in to comment.