mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add "trim(always)" to CSV decoder. Whitespace between comma
separated items will no longer cause validation issues - excess whitespace is automatically trimmed at the beginning and end of comma separated entries before parsing. First part of ISSUE #240 (Fixing the validation issue rather than the actual cause)
This commit is contained in:
@@ -53,7 +53,7 @@ impl ConfigShapedDevices {
|
||||
pub fn load() -> Result<Self, ShapedDevicesError> {
|
||||
let final_path = ConfigShapedDevices::path()?;
|
||||
let reader =
|
||||
ReaderBuilder::new().comment(Some(b'#')).from_path(final_path);
|
||||
ReaderBuilder::new().comment(Some(b'#')).trim(csv::Trim::All).from_path(final_path);
|
||||
if reader.is_err() {
|
||||
error!("Unable to read ShapedDevices.csv");
|
||||
return Err(ShapedDevicesError::OpenFail);
|
||||
|
||||
Reference in New Issue
Block a user