diff options
author | Sam Scott <sam@osohq.com> | 2022-03-05 21:19:28 -0600 |
---|---|---|
committer | Sam Scott <sam@osohq.com> | 2022-03-05 21:25:17 -0600 |
commit | 4bd3699faba3f00dd8f59a358605abb6e485deb9 (patch) | |
tree | 3570c30f8e8f6cd4a1aa1e9b7ec1bf2330c9d33a /src/ser.rs | |
parent | 58c1832578a103498b0120469b7a5d84833ad1b5 (diff) |
Add error message hint for strict mode.
Diffstat (limited to 'src/ser.rs')
-rw-r--r-- | src/ser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10,7 +10,7 @@ use std::fmt::Display; use std::io::Write; use std::str; -const QS_ENCODE_SET: &AsciiSet = &NON_ALPHANUMERIC +pub const QS_ENCODE_SET: &AsciiSet = &NON_ALPHANUMERIC .remove(b' ') .remove(b'*') .remove(b'-') @@ -104,7 +104,7 @@ pub struct QsSerializer<'a, W: 'a + Write> { first: &'a mut bool, } -fn replace_space(input: &str) -> Cow<str> { +pub fn replace_space(input: &str) -> Cow<str> { match input.as_bytes().iter().position(|&b| b == b' ') { None => Cow::Borrowed(input), Some(first_position) => { |