Skip to content

Commit

Permalink
🦺 Simplify handling of <listen> elements
Browse files Browse the repository at this point in the history
  • Loading branch information
jokeyrhyme committed Oct 27, 2024
1 parent eaa48f6 commit 7690c41
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ pub struct BusConfig {
/// Address(es) that the bus should listen on.
/// The address is in the standard D-Bus format that contains a transport name plus possible parameters/options.
#[query(".listen")]
// TODO: consider finding a way to make this `Vec<String>` instead of `Option<Vec<String>>`
pub listen: Option<Vec<String>>,
#[serde(default)]
pub listen: Vec<String>,

/// The bus daemon will write its pid to the specified file.
#[query(".pidfile")]
Expand Down Expand Up @@ -240,11 +240,11 @@ mod tests {
assert_eq!(
busconfig,
BusConfig {
listen: Some(vec![
listen: vec![
String::from("unix:path=/tmp/foo"),
String::from("tcp:host=localhost,port=1234"),
String::from("tcp:host=localhost,port=0,family=ipv4"),
]),
],
..Default::default()
}
);
Expand Down

0 comments on commit 7690c41

Please sign in to comment.