Fixed minor bug within read_pedals(3)

This commit is contained in:
Dennis Potter 2018-08-07 00:52:56 +02:00
parent 6fd43a14ed
commit bef171200e

View File

@ -92,7 +92,6 @@ impl Pedals {
/// Read the current values of the pedals /// Read the current values of the pedals
pub fn read_pedals(&self, dev: & hidapi::HidDevice, peds: Vec<u8>) { pub fn read_pedals(&self, dev: & hidapi::HidDevice, peds: Vec<u8>) {
// This is kind of hacky, but for number of pedals == 2, the table shifts.
let total_width = 55 as usize; let total_width = 55 as usize;
// Check if passed pedal number is valid // Check if passed pedal number is valid
@ -126,7 +125,7 @@ impl Pedals {
None => "< None >".to_string(), None => "< None >".to_string(),
}; };
println!("│ Pedal {ped}{name:<-width$}", ped = i, name = key_name, width = total_width - 14); println!("│ Pedal {ped}{name:<-width$}", ped = ped, name = key_name, width = total_width - 14);
// Print spacer between lines // Print spacer between lines
if i != peds.len() - 1 { if i != peds.len() - 1 {