File tree 2 files changed +6
-3
lines changed 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1106,7 +1106,10 @@ impl Binary {
1106
1106
/// Creates a [`Binary`] from a base64 string and optional [`BinarySubtype`]. If the
1107
1107
/// `subtype` argument is `None`, the [`Binary`] constructed will default to
1108
1108
/// [`BinarySubtype::Generic`].
1109
- pub fn from_base64 ( input : & str , subtype : impl Into < Option < BinarySubtype > > ) -> Result < Self , DecodeError > {
1109
+ pub fn from_base64 (
1110
+ input : & str ,
1111
+ subtype : impl Into < Option < BinarySubtype > > ,
1112
+ ) -> Result < Self , DecodeError > {
1110
1113
let bytes = base64:: decode ( input) ?;
1111
1114
let subtype = match subtype. into ( ) {
1112
1115
Some ( s) => s,
Original file line number Diff line number Diff line change 1
- use crate :: { tests:: LOCK , Binary , spec :: BinarySubtype } ;
1
+ use crate :: { spec :: BinarySubtype , tests:: LOCK , Binary } ;
2
2
3
3
#[ test]
4
4
fn binary_from_base64 ( ) {
@@ -16,7 +16,7 @@ fn binary_from_base64() {
16
16
let produced = Binary :: from_base64 ( "" , Some ( BinarySubtype :: Uuid ) ) . unwrap ( ) ;
17
17
let expected = Binary {
18
18
bytes : "" . as_bytes ( ) . to_vec ( ) ,
19
- subtype : BinarySubtype :: Uuid
19
+ subtype : BinarySubtype :: Uuid ,
20
20
} ;
21
21
assert_eq ! ( produced, expected) ;
22
22
}
You can’t perform that action at this time.
0 commit comments