summaryrefslogtreecommitdiff
path: root/src/de/parse.rs
diff options
context:
space:
mode:
authorSam Scott <sam@osohq.com>2022-07-10 15:33:37 -0500
committerSam Scott <sam@osohq.com>2022-07-10 15:33:37 -0500
commit0459c5e88e90e297ddb916ab96e62cdfaf7c3414 (patch)
tree5884a203471b2e7d99f6600a79227ef8da858aa9 /src/de/parse.rs
parent0c8dc4ae5382af826f6bc52b816dca37e48f7320 (diff)
Formatting.
Diffstat (limited to 'src/de/parse.rs')
-rw-r--r--src/de/parse.rs31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/de/parse.rs b/src/de/parse.rs
index fe14bb4..20ba962 100644
--- a/src/de/parse.rs
+++ b/src/de/parse.rs
@@ -250,24 +250,23 @@ impl<'a> Parser<'a> {
decoder.decode_utf8_lossy()
};
- let ret: Result<Cow<'a, str>> =
- match maybe_decoded {
- Cow::Borrowed(_) => {
- match replaced {
- Cow::Borrowed(_) => {
- // In this case, neither method made replacements, so we
- // reuse the original bytes
- let res = str::from_utf8(&self.inner[self.acc.0..self.acc.1 - 1])?;
- Ok(Cow::Borrowed(res))
- }
- Cow::Owned(owned) => {
- let res = String::from_utf8(owned)?;
- Ok(Cow::Owned(res))
- }
+ let ret: Result<Cow<'a, str>> = match maybe_decoded {
+ Cow::Borrowed(_) => {
+ match replaced {
+ Cow::Borrowed(_) => {
+ // In this case, neither method made replacements, so we
+ // reuse the original bytes
+ let res = str::from_utf8(&self.inner[self.acc.0..self.acc.1 - 1])?;
+ Ok(Cow::Borrowed(res))
+ }
+ Cow::Owned(owned) => {
+ let res = String::from_utf8(owned)?;
+ Ok(Cow::Owned(res))
}
}
- Cow::Owned(owned) => Ok(Cow::Owned(owned)),
- };
+ }
+ Cow::Owned(owned) => Ok(Cow::Owned(owned)),
+ };
self.clear_acc();
ret.map_err(Error::from)
}