1
0
Fork 0
forked from wry/wry

remove trailing commas and whitespace

This commit is contained in:
Mostafa Ibrahim 2025-06-20 11:22:34 +03:00
parent 7373509274
commit 983eb6a1f1

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) => {