@@ -164,11 +164,11 @@ impl std::fmt::Display for KeyValue {
164164 match self {
165165 KeyValue :: Bytes ( v) => write ! ( f, "{}" , BASE64_STANDARD . encode( v) ) ,
166166 KeyValue :: Str ( v) => write ! ( f, "\" {}\" " , v. escape_default( ) ) ,
167- KeyValue :: Bool ( v) => write ! ( f, "{}" , v ) ,
168- KeyValue :: Int64 ( v) => write ! ( f, "{}" , v ) ,
167+ KeyValue :: Bool ( v) => write ! ( f, "{v}" ) ,
168+ KeyValue :: Int64 ( v) => write ! ( f, "{v}" ) ,
169169 KeyValue :: Range ( v) => write ! ( f, "[{}, {})" , v. start, v. end) ,
170- KeyValue :: Uuid ( v) => write ! ( f, "{}" , v ) ,
171- KeyValue :: Date ( v) => write ! ( f, "{}" , v ) ,
170+ KeyValue :: Uuid ( v) => write ! ( f, "{v}" ) ,
171+ KeyValue :: Date ( v) => write ! ( f, "{v}" ) ,
172172 KeyValue :: Struct ( v) => {
173173 write ! (
174174 f,
@@ -191,7 +191,7 @@ impl KeyValue {
191191 let field_values: FieldValues = FieldValues :: from_json ( value, fields_schema) ?;
192192 Value :: Struct ( field_values)
193193 } ;
194- Ok ( value. as_key ( ) ? )
194+ value. as_key ( )
195195 }
196196
197197 pub fn from_values < ' a > ( values : impl ExactSizeIterator < Item = & ' a Value > ) -> Result < Self > {
@@ -226,10 +226,10 @@ impl KeyValue {
226226 . next ( )
227227 . ok_or_else ( || api_error ! ( "Key parts less than expected" ) ) ?;
228228 match basic_type {
229- BasicValueType :: Bytes { .. } => {
229+ BasicValueType :: Bytes => {
230230 KeyValue :: Bytes ( Bytes :: from ( BASE64_STANDARD . decode ( v) ?) )
231231 }
232- BasicValueType :: Str { .. } => KeyValue :: Str ( Arc :: from ( v) ) ,
232+ BasicValueType :: Str => KeyValue :: Str ( Arc :: from ( v) ) ,
233233 BasicValueType :: Bool => KeyValue :: Bool ( v. parse ( ) ?) ,
234234 BasicValueType :: Int64 => KeyValue :: Int64 ( v. parse ( ) ?) ,
235235 BasicValueType :: Range => {
@@ -1030,12 +1030,10 @@ impl serde::Serialize for BasicValue {
10301030impl BasicValue {
10311031 pub fn from_json ( value : serde_json:: Value , schema : & BasicValueType ) -> Result < Self > {
10321032 let result = match ( value, schema) {
1033- ( serde_json:: Value :: String ( v) , BasicValueType :: Bytes { .. } ) => {
1033+ ( serde_json:: Value :: String ( v) , BasicValueType :: Bytes ) => {
10341034 BasicValue :: Bytes ( Bytes :: from ( BASE64_STANDARD . decode ( v) ?) )
10351035 }
1036- ( serde_json:: Value :: String ( v) , BasicValueType :: Str { .. } ) => {
1037- BasicValue :: Str ( Arc :: from ( v) )
1038- }
1036+ ( serde_json:: Value :: String ( v) , BasicValueType :: Str ) => BasicValue :: Str ( Arc :: from ( v) ) ,
10391037 ( serde_json:: Value :: Bool ( v) , BasicValueType :: Bool ) => BasicValue :: Bool ( v) ,
10401038 ( serde_json:: Value :: Number ( v) , BasicValueType :: Int64 ) => BasicValue :: Int64 (
10411039 v. as_i64 ( )
0 commit comments