1
0
Fork 0
forked from wry/wry

Merge pull request #488 from disluckyguy/remove-trailing-commas

remove trailing commas and whitespace
This commit is contained in:
mahkoh 2025-06-20 15:06:29 +02:00 committed by GitHub
commit 21b724bd25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -181,10 +181,13 @@ async fn handle_i3bar(name: String, mut read: BufReader<Async<OwnedFd>>) {
let mut status = String::new();
loop {
read_line!();
let mut line = line.as_str();
let mut line = line.trim();
if let Some(l) = line.strip_prefix(",") {
line = l;
}
if let Some(l) = line.strip_suffix(",") {
line = l;
}
let components = match serde_json::from_str::<Vec<Component>>(line) {
Ok(c) => c,
Err(e) => {