summaryrefslogtreecommitdiff
path: root/src/de/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/de/mod.rs')
-rw-r--r--src/de/mod.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/de/mod.rs b/src/de/mod.rs
index ef9cd76..290d843 100644
--- a/src/de/mod.rs
+++ b/src/de/mod.rs
@@ -189,7 +189,7 @@ pub fn from_str<'de, T: de::Deserialize<'de>>(input: &'de str) -> Result<T> {
/// A deserializer for the querystring format.
///
/// Supported top-level outputs are structs and maps.
-pub(crate) struct QsDeserializer<'a> {
+pub struct QsDeserializer<'a> {
iter: IntoIter<Cow<'a, str>, Level<'a>>,
value: Option<Level<'a>>,
}
@@ -213,9 +213,13 @@ impl<'a> QsDeserializer<'a> {
}
/// Returns a new `QsDeserializer<'a>`.
- fn with_config(config: &Config, input: &'a [u8]) -> Result<Self> {
+ pub fn with_config(config: &Config, input: &'a [u8]) -> Result<Self> {
parse::Parser::new(input, config.max_depth(), config.strict).as_deserializer()
}
+
+ pub fn new(input: &'a [u8]) -> Result<Self> {
+ Self::with_config(&Config::default(), input)
+ }
}
impl<'de> de::Deserializer<'de> for QsDeserializer<'de> {