Skip to content

Commit 33dc28f

Browse files
committed
Code review fixes
1 parent e93af7d commit 33dc28f

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
@@ -17560,20 +17560,20 @@ impl<'a> Parser<'a> {
1756017560
// Can be a list of values or a list of key value properties.
1756117561
// Try to parse a list of values and if that fails, try to parse
1756217562
// a list of key-value properties.
17563-
match self.try_parse(|parser| {
17563+
match self.maybe_parse(|parser| {
1756417564
parser.expect_token(&Token::LParen)?;
1756517565
let values = parser.parse_comma_separated0(|p| p.parse_value(), Token::RParen);
1756617566
parser.expect_token(&Token::RParen)?;
1756717567
values
17568-
}) {
17569-
Ok(values) => {
17568+
})? {
17569+
Some(values) => {
1757017570
let values = values.into_iter().map(|v| v.value).collect();
1757117571
Ok(KeyValueOption {
1757217572
option_name: key.value.clone(),
1757317573
option_value: KeyValueOptionKind::Multi(values),
1757417574
})
1757517575
}
17576-
_ => Ok(KeyValueOption {
17576+
None => Ok(KeyValueOption {
1757717577
option_name: key.value.clone(),
1757817578
option_value: KeyValueOptionKind::KeyValueOptions(Box::new(
1757917579
self.parse_key_value_options(true, &[])?,

0 commit comments

Comments
 (0)