Skip to content

Commit

Permalink
Fix Matchrule parser error
Browse files Browse the repository at this point in the history
  • Loading branch information
diwic committed Oct 1, 2024
1 parent 0b8a815 commit a24953b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dbus/src/message/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub enum Error {
BadBoolean,
/// Error that occurred while converting a string to a DBus format
BadConversion(String),
/// Key with no value
NoValue,
}

impl Display for Error {
Expand All @@ -51,6 +53,9 @@ impl Display for Error {
Error::BadConversion(err) => {
write!(f, "Error while converting: {}", err)
}
Error::NoValue => {
write!(f, "Key with no value")
}
}
}
}
Expand Down Expand Up @@ -123,6 +128,8 @@ impl<'a> Tokenizer<'a> {
while !self.text.is_empty() {
let (key, rest) = self.key();
self.text = rest;
if self.text.is_empty()
{ return Err(Error::NoValue) }
let (value, rest) = self.value();
self.text = rest;
rules.push((key, value))
Expand Down

0 comments on commit a24953b

Please sign in to comment.