fixup! feat(cli): allow printing selected DDS messages to the console

This commit is contained in:
Mika Vilpas 2024-06-15 10:20:52 +03:00
parent 2d3cd4d50e
commit 390dbc1f44

View file

@ -71,14 +71,14 @@ impl Client {
let mut lines = Self::connect_listener(&kinds).await?; let mut lines = Self::connect_listener(&kinds).await?;
loop { loop {
match lines.next_line().await { match lines.next_line().await? {
Ok(Some(s)) => { Some(s) => {
let kind = s.split(',').next(); let kind = s.split(',').next();
if matches!(kind, Some(kind) if kinds.contains(kind)) { if matches!(kind, Some(kind) if kinds.contains(kind)) {
println!("{}", s); println!("{}", s);
} }
} }
Ok(None) => loop { None => loop {
println!("Connection closed"); println!("Connection closed");
match Self::connect_listener(&kinds).await { match Self::connect_listener(&kinds).await {
Ok(new_lines) => { Ok(new_lines) => {
@ -90,10 +90,6 @@ impl Client {
} }
}; };
}, },
Err(e) => {
// could not establish initial connection
return Err(e.into());
}
} }
} }
} }