Skip to content

Commit 98d3b97

Browse files
committed
Missed a couple
1 parent 13b938c commit 98d3b97

File tree

1 file changed

+5
-4
lines changed
  • rust-runtime/aws-smithy-json/src/deserialize

1 file changed

+5
-4
lines changed

rust-runtime/aws-smithy-json/src/deserialize/token.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,10 @@ pub fn expect_number_or_null(
188188
/// Expects a [Token::ValueString] or [Token::ValueNull]. If the value is a string, it interprets it as a base64 encoded [Blob] value.
189189
pub fn expect_blob_or_null(token: Option<Result<Token<'_>, Error>>) -> Result<Option<Blob>, Error> {
190190
Ok(match expect_string_or_null(token)? {
191-
Some(value) => Some(Blob::new(base64::decode(value.as_escaped_str()).map_err(
192-
|err| Error::custom(format!("failed to decode base64: {}", err)),
193-
)?)),
191+
Some(value) => Some(Blob::new(
192+
base64::decode(value.as_escaped_str())
193+
.map_err(|err| Error::custom_source("failed to decode base64", err))?,
194+
)),
194195
None => None,
195196
})
196197
}
@@ -218,7 +219,7 @@ pub fn expect_timestamp_or_null(
218219
Format::DateTime | Format::HttpDate => expect_string_or_null(token)?
219220
.map(|v| DateTime::from_str(v.as_escaped_str(), timestamp_format))
220221
.transpose()
221-
.map_err(|err| Error::custom(format!("failed to parse timestamp: {}", err)))?,
222+
.map_err(|err| Error::custom_source("failed to parse timestamp", err))?,
222223
})
223224
}
224225

0 commit comments

Comments
 (0)