@@ -350,7 +350,7 @@ fn build_extra_fields_export(
350350 "valueReference" . into ( ) ,
351351 serde_json:: Value :: String ( field. kind . as_str ( ) . to_string ( ) ) ,
352352 ) ;
353- node. insert ( "value" . into ( ) , value_to_json ( field, ValueShape :: Property ) ) ;
353+ node. insert ( "value" . into ( ) , value_to_json ( field) ) ;
354354
355355 if let Some ( unit) = & field. unit {
356356 node. insert ( "unitText" . into ( ) , serde_json:: Value :: String ( unit. clone ( ) ) ) ;
@@ -464,7 +464,7 @@ fn reconstruct_elabftw_metadata(
464464 ) ,
465465 ) ;
466466 } else {
467- obj. insert ( "value" . into ( ) , value_to_json ( field, ValueShape :: Metadata ) ) ;
467+ obj. insert ( "value" . into ( ) , value_to_json ( field) ) ;
468468 }
469469
470470 if let Some ( position) = field. position {
@@ -517,13 +517,6 @@ fn reconstruct_elabftw_metadata(
517517}
518518
519519/// Convert a field's value into the most appropriate JSON type.
520- enum ValueShape {
521- /// Shape used in PropertyValue nodes.
522- Property ,
523- /// Shape used in the embedded eLabFTW metadata JSON.
524- Metadata ,
525- }
526-
527520/// Convert an ExtraField's value into a serde_json::Value suitable for export.
528521///
529522/// The result is:
@@ -546,7 +539,7 @@ enum ValueShape {
546539/// kind: ExtraFieldKind::Items,
547540/// ..Default::default()
548541/// };
549- /// let v = crate::logic::eln::value_to_json(&f_multi, crate::logic::eln::ValueShape::Property );
542+ /// let v = crate::logic::eln::value_to_json(&f_multi);
550543/// assert_eq!(v, Value::Array(vec![Value::String("a".into()), Value::String("b".into())]));
551544///
552545/// // numeric kind exported as string
@@ -557,10 +550,10 @@ enum ValueShape {
557550/// kind: ExtraFieldKind::Number,
558551/// ..Default::default()
559552/// };
560- /// let v2 = crate::logic::eln::value_to_json(&f_num, crate::logic::eln::ValueShape::Property );
553+ /// let v2 = crate::logic::eln::value_to_json(&f_num);
561554/// assert_eq!(v2, Value::String("3.14".into()));
562555/// ```
563- fn value_to_json ( field : & ExtraField , _shape : ValueShape ) -> serde_json:: Value {
556+ fn value_to_json ( field : & ExtraField ) -> serde_json:: Value {
564557 if field. allow_multi_values && !field. value_multi . is_empty ( ) {
565558 return serde_json:: Value :: Array (
566559 field
0 commit comments