mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
fix comma formatting in pddb lists to not put a trailing comma
This commit is contained in:
parent
18b97cea83
commit
1d27265d02
1 changed files with 12 additions and 2 deletions
|
|
@ -85,7 +85,12 @@ impl<'a> ShellCmdApi<'a> for PddbCmd {
|
|||
list.len()
|
||||
};
|
||||
for i in 0..checked_len {
|
||||
match write!(ret, "{}, ", list[i]) {
|
||||
let sep = if i != checked_len - 1 {
|
||||
", "
|
||||
} else {
|
||||
""
|
||||
};
|
||||
match write!(ret, "{}{}", list[i], sep) {
|
||||
Ok(_) => (),
|
||||
Err(_) => break, // overflowed return buffer
|
||||
}
|
||||
|
|
@ -107,7 +112,12 @@ impl<'a> ShellCmdApi<'a> for PddbCmd {
|
|||
list.len()
|
||||
};
|
||||
for i in 0..checked_len {
|
||||
match write!(ret, "{}, ", list[i]) {
|
||||
let sep = if i != checked_len - 1 {
|
||||
", "
|
||||
} else {
|
||||
""
|
||||
};
|
||||
match write!(ret, "{}{}", list[i], sep) {
|
||||
Ok(_) => (),
|
||||
Err(_) => break, // overflowed return buffer
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue