/// Coverts this type into a string to be included in rust code.
Coverts this type into a string to be included in rust code.
Coverts this type into a string to be included in rust code .
fn to_string(&self) -> String {
        match self {
            DataType::Literal(ref id) => {
                // only do the parsing song and dance if this looks like a URL
                let typename = if id.contains("://") {
                    Node::new(&id).fieldname().to_camel_case()
                } else {
                    id.to_string()
                };
                typename
            }
            DataType::RangeEnum(ref name) => {
                let typename = name.clone();
                typename
            }
            _ => {
                let jval = serde_json::to_value(self).unwrap();
                if let Value::String(val) = jval {
                    val
                } else {
                    panic!("failed to deserialized type {:?} -- {:?}", self, jval);
                }
            }
        }
    }
fn to_string ( & self ) -> String { match self { DataType :: Literal ( ref id ) => { // only do the parsing song and dance if this looks like a URL let typename = if id . contains ( " " ) { Node :: new ( & id ) . fieldname ( ) . to_camel_case ( ) } else { id . to_string ( ) } ; typename } DataType :: RangeEnum ( ref name ) => { let typename = name . clone ( ) ; typename } _ => { let jval = serde_json :: to_value ( self ) . unwrap ( ) ; if let Value :: String ( val ) = jval { val } else { panic ! ( " " self jval ) ; } } } }
Coverts this type into a string to be included in rust code.
Coverts this type into a string to be included in rust code .
&self