From fe113ec18edd831c4c3288c175097d66fcc07a18 Mon Sep 17 00:00:00 2001 From: zabackary <137591653+zabackary@users.noreply.github.com> Date: Tue, 9 Jul 2024 20:36:36 +0900 Subject: [PATCH] fix: correctly read boolean fields --- src/rtd_state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rtd_state.rs b/src/rtd_state.rs index 6f696f2..d4073a3 100644 --- a/src/rtd_state.rs +++ b/src/rtd_state.rs @@ -185,7 +185,7 @@ impl RTDState { /// format. pub fn field_bool(&self, item: usize) -> Result { self.field_str(item, 1, RTDFieldJustification::None) - .map(|char| !char.is_empty()) + .map(|char| !char.trim().is_empty()) } } @@ -221,7 +221,7 @@ impl std::error::Error for RTDStateFieldError {} /// The justification of the field in the RTDState /// -/// Passing `Left` will trip the right side of the value for whitespace, `Right` +/// Passing `Left` will trim the right side of the value for whitespace, `Right` /// will trim the left, and `None` will avoid whitespace processing and will /// return the raw value. #[derive(Debug)]