Merge pull request #488 from disluckyguy/remove-trailing-commas
remove trailing commas and whitespace
This commit is contained in:
commit
21b724bd25
1 changed files with 4 additions and 1 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue