Skip to content

Float deserialisation: difference in Rust & Python parsing #375

@RickyDaMa

Description

@RickyDaMa

A weird nuance that we spotted internally when someone's designspace wouldn't load in Rust tooling

Rust does not permit extra surrounding whitespace in strings being parsed. " 123".parse::<f32>() is an Err(InvalidDigit)

Python allows this, parsing without issue, giving 123.0

Are we happy being more pedantic or did we want to consider stripping whitespace to match behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions