From d4c90ba8f3e4d69412ad782a40acf6fe6814a7bf Mon Sep 17 00:00:00 2001 From: myyrakle Date: Tue, 27 Aug 2024 02:27:39 +0900 Subject: [PATCH] =?UTF-8?q?[#15]=20impl=20QueryString=20=EC=8B=A4=EC=88=98?= =?UTF-8?q?=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rupring/src/request.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/rupring/src/request.rs b/rupring/src/request.rs index bf32f5a..81766c9 100644 --- a/rupring/src/request.rs +++ b/rupring/src/request.rs @@ -195,6 +195,30 @@ impl QueryStringDeserializer for QueryString { } } +impl QueryStringDeserializer for QueryString { + type Error = (); + + fn deserialize(&self) -> Result { + if let Some(e) = self.0.get(0) { + e.parse::().map_err(|_| ()) + } else { + Err(()) + } + } +} + +impl QueryStringDeserializer for QueryString { + type Error = (); + + fn deserialize(&self) -> Result { + if let Some(e) = self.0.get(0) { + e.parse::().map_err(|_| ()) + } else { + Err(()) + } + } +} + #[derive(Debug, Clone)] pub struct ParamString(pub String);