From 0459c5e88e90e297ddb916ab96e62cdfaf7c3414 Mon Sep 17 00:00:00 2001 From: Sam Scott Date: Sun, 10 Jul 2022 15:33:37 -0500 Subject: Formatting. --- src/de/parse.rs | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/de') 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> = - 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> = 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) } -- cgit v1.2.3