fn float_to_value(value: f64, field: &FieldDescriptor) -> Result<Value, &'static str>{
    match field.kind(){
        // Float
        Kind::Double => Ok(Value::F64(value)),
        // Datetime
        Kind::Message(message_descriptor) if message_descriptor.full_name() == "q.datetime" => {
            let mut inner = DynamicMessage::new(message_descriptor.clone());
            inner.set_field_by_name("days", Value::F64(value));
            Ok(Value::Message(inner))
        },
        // There are no other float compatible type
        _ => Err("non-float value\0")
    }
}
/// Convert underlying float value to `Value`.
Convert underlying float value to `Value`.
Convert underlying float value to ` Value ` .
fn float_to_value(value: f64, field: &FieldDescriptor) -> Result<Value, &'static str>{
    match field.kind(){
        // Float
        Kind::Double => Ok(Value::F64(value)),
        // Datetime
        Kind::Message(message_descriptor) if message_descriptor.full_name() == "q.datetime" => {
            let mut inner = DynamicMessage::new(message_descriptor.clone());
            inner.set_field_by_name("days", Value::F64(value));
            Ok(Value::Message(inner))
        },
        // There are no other float compatible type
        _ => Err("non-float value\0")
    }
}
fn float_to_value ( value : f64 , field : & FieldDescriptor ) -> Result < Value , & ' static str > { match field . kind ( ) { // Float Kind :: Double => Ok ( Value :: F64 ( value ) ) , // Datetime Kind :: Message ( message_descriptor ) if message_descriptor . full_name ( ) == " " => { let mut inner = DynamicMessage :: new ( message_descriptor . clone ( ) ) ; inner . set_field_by_name ( " " , Value :: F64 ( value ) ) ; Ok ( Value :: Message ( inner ) ) } , // There are no other float compatible type _ => Err ( " \0 " ) } }
Convert underlying float value to `Value`.
Convert underlying float value to ` Value ` .
value
f64
field
&FieldDescriptor
value
f64
field
&FieldDescriptor