Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the way the conversion factor is obtained in serde and Debug impls #33

Closed
Tehforsch opened this issue Dec 1, 2023 · 0 comments · Fixed by #73
Closed

Fix the way the conversion factor is obtained in serde and Debug impls #33

Tehforsch opened this issue Dec 1, 2023 · 0 comments · Fixed by #73

Comments

@Tehforsch
Copy link
Owner

The code is extremely ugly. Should be easy enough to generate code that matches all defined units, in code similar to the following

let conversion_factor =
if D == Dimension { length: 0, ..NONE } {
    match unit_symbol {
        "%" => 0.01,
        "dimensionless" => 1.0,
    }
}
@Tehforsch Tehforsch linked a pull request Jan 15, 2024 that will close this issue
@Tehforsch Tehforsch removed a link to a pull request Jan 16, 2024
@Tehforsch Tehforsch linked a pull request Feb 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant