This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch config-refactor
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/config-refactor by this push:
     new f7d100456 FIx on support
f7d100456 is described below

commit f7d10045698c3ee2d5a1cfd297da5314752b06b3
Author: Xuanwo <[email protected]>
AuthorDate: Mon Nov 6 20:37:20 2023 +0800

    FIx on support
    
    Signed-off-by: Xuanwo <[email protected]>
---
 core/src/raw/serde_util.rs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/src/raw/serde_util.rs b/core/src/raw/serde_util.rs
index 93c2cae3b..e326c99a7 100644
--- a/core/src/raw/serde_util.rs
+++ b/core/src/raw/serde_util.rs
@@ -112,11 +112,12 @@ impl<'de> Deserializer<'de> for Pair {
     where
         V: Visitor<'de>,
     {
-        match self.1.parse::<bool>() {
-            Ok(val) => val.into_deserializer().deserialize_bool(visitor),
-            Err(e) => Err(de::Error::custom(format_args!(
+        match self.1.to_lowercase().as_str() {
+            "true" | "on" => 
true.into_deserializer().deserialize_bool(visitor),
+            "false" | "off" => 
false.into_deserializer().deserialize_bool(visitor),
+            _ => Err(de::Error::custom(format_args!(
                 "parse config '{}' with value '{}' failed for {:?}",
-                self.0, self.1, e
+                self.0, self.1, "invalid bool value"
             ))),
         }
     }

Reply via email to