Skip to content

Debug implementation shouldn't display the NotNan wrapper #152

@Ten0

Description

@Ten0

Currently the debug implementation of NotNan is:

        Struct {
            f1: NotNan(
                18.25409836065574,
            ),
            f2: NotNan(
                0.11689901383196721,
            ),
        },

This seems unnecessarily verbose: when debugging structs that contain NotNan floats, we are probably interested by the values, without being particularly interested by being reminded at every step that they can't be NaN (I mean, we see that they are not NaN in their values anyway).

I would much prefer to read:

        Struct {
            f1: 18.25409836065574,
            f2: 0.11689901383196721,
        },

=> It would be useful to have the Debug implementation directly delegate to the inner float, instead of just being a #[derive(Debug)].

Is that something that sounds ok? (I can PR this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions