// Float parsing is stupidly hard.
Float parsing is stupidly hard.
Float parsing is stupidly hard .
fn deserialize_f32<V>(self, visitor: V) -> Result<V::Value>
    where
        V: Visitor<'de>,
    {
        // from RetroShare
        // f = 1.0f/ ( n/(float)(~(uint32_t)0)) - 1.0f ;
        const SIZE: usize = 4;
        let d: Vec<u8> = self.input.drain(0..SIZE).collect();
        let n = NetworkEndian::read_u32(d.as_slice()); // can this be done with deserialize_u32?!
        let f: f32 = 1 as f32 / (n as f32 / (!(0 as u32) as f32)) - 1 as f32;
        visitor.visit_f32(f)
    }
fn deserialize_f32 < V > ( self , visitor : V ) -> Result < V :: Value > where V : Visitor < ' de > , { // from RetroShare // f = 1.0f/ ( n/(float)(~(uint32_t)0)) - 1.0f ; const SIZE : usize = 4 ; let d : Vec < u8 > = self . input . drain ( 0 .. SIZE ) . collect ( ) ; let n = NetworkEndian :: read_u32 ( d . as_slice ( ) ) ; // can this be done with deserialize_u32?! let f : f32 = 1 as f32 / ( n as f32 / ( ! ( 0 as u32 ) as f32 ) ) - 1 as f32 ; visitor . visit_f32 ( f ) }
Float parsing is stupidly hard.
Float parsing is stupidly hard .
self
visitor
V