Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Avoid string conversion when working with Value #70

@tgross35

Description

@tgross35

Rather than having Value always be a String, something like this could be better:

enum Value {
    String(String),
    Integer(i64),
    Float(f64),
}

And then the From implementations would just set an Integer or Float. This would be nice because it means that numbers (which account for a lot of possible values) never have to allocate.

Doing deref to str wouldn't be the best thing with this change. Something like as_string() -> String might be better suited.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions