File tree 1 file changed +5
-4
lines changed
rust-runtime/aws-smithy-json/src/deserialize
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -188,9 +188,10 @@ pub fn expect_number_or_null(
188
188
/// Expects a [Token::ValueString] or [Token::ValueNull]. If the value is a string, it interprets it as a base64 encoded [Blob] value.
189
189
pub fn expect_blob_or_null ( token : Option < Result < Token < ' _ > , Error > > ) -> Result < Option < Blob > , Error > {
190
190
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
+ ) ) ,
194
195
None => None ,
195
196
} )
196
197
}
@@ -218,7 +219,7 @@ pub fn expect_timestamp_or_null(
218
219
Format :: DateTime | Format :: HttpDate => expect_string_or_null ( token) ?
219
220
. map ( |v| DateTime :: from_str ( v. as_escaped_str ( ) , timestamp_format) )
220
221
. 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) ) ?,
222
223
} )
223
224
}
224
225
You can’t perform that action at this time.
0 commit comments