Skip to content

Commit cfa1572

Browse files
committed
Code review fixes
1 parent 50f2120 commit cfa1572

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

src/ast/helpers/key_value_options.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ pub struct KeyValueOptions {
3939
pub delimiter: KeyValueOptionsDelimiter,
4040
}
4141

42-
impl KeyValueOptions {
43-
/// Returns true iff the options list is empty
44-
pub fn is_empty(&self) -> bool {
45-
self.options.is_empty()
46-
}
47-
}
48-
4942
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
5043
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5144
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))]

src/ast/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10739,7 +10739,7 @@ impl fmt::Display for AlterUser {
1073910739
if let Some(policy_kind) = &self.unset_policy {
1074010740
write!(f, " UNSET {policy_kind} POLICY")?;
1074110741
}
10742-
if !self.set_tag.is_empty() {
10742+
if !self.set_tag.options.is_empty() {
1074310743
write!(f, " SET TAG {}", self.set_tag)?;
1074410744
}
1074510745
if !self.unset_tag.is_empty() {

src/parser/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17562,20 +17562,20 @@ impl<'a> Parser<'a> {
1756217562
// Can be a list of values or a list of key value properties.
1756317563
// Try to parse a list of values and if that fails, try to parse
1756417564
// a list of key-value properties.
17565-
match self.try_parse(|parser| {
17565+
match self.maybe_parse(|parser| {
1756617566
parser.expect_token(&Token::LParen)?;
1756717567
let values = parser.parse_comma_separated0(|p| p.parse_value(), Token::RParen);
1756817568
parser.expect_token(&Token::RParen)?;
1756917569
values
17570-
}) {
17571-
Ok(values) => {
17570+
})? {
17571+
Some(values) => {
1757217572
let values = values.into_iter().map(|v| v.value).collect();
1757317573
Ok(KeyValueOption {
1757417574
option_name: key.value.clone(),
1757517575
option_value: KeyValueOptionKind::Multi(values),
1757617576
})
1757717577
}
17578-
_ => Ok(KeyValueOption {
17578+
None => Ok(KeyValueOption {
1757917579
option_name: key.value.clone(),
1758017580
option_value: KeyValueOptionKind::KeyValueOptions(Box::new(
1758117581
self.parse_key_value_options(true, &[])?,

0 commit comments

Comments
 (0)