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

thermal: remove panic formatting and Debug impls #1738

Merged
merged 2 commits into from
Apr 8, 2024
Merged

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Apr 8, 2024

Currently, the thermal task uses unwrap() in a bunch of places,
requiring it to derive Debug for a bunch of stuff. This commit changes
those to unwrap_lite(), and removes many of the derived Debug impls.
On gimlet-f, this shaves off about 1K of flash:

before:


thermal              flash   23316  23328  32768
                     ram     7820   8192   8192

after:

thermal              flash   22392  22400  32768
                     ram     7820   8192   8192

It would be nice to also remove the derived Debug from types like
SensorId, but it looks like that's currently used by validate_api
--- I wasn't sure if any of the validate_api types are used in
control-plane comms, so I didn't touch that yet. May do so in a
follow-up.

Currently, the `thermal` task uses `unwrap()` in a bunch of places,
requiring it to derive `Debug` for a bunch of stuff. This commit changes
those to `unwrap_lite()`, and removes many of the derived `Debug` impls.
On `gimlet-f`, this shaves off about 1K of flash:

before:
```

thermal              flash   23316  23328  32768
                     ram     7820   8192   8192
```

after:

```
thermal              flash   22392  22400  32768
                     ram     7820   8192   8192
```

It would be nice to also remove the derived `Debug` from types like
`SensorId`, but it looks like that's currently used by `validate_api`
--- I wasn't sure if any of the `validate_api` types are used in
control-plane comms, so I didn't touch that yet. May do so in a
follow-up.
@hawkw hawkw requested a review from mkeeter April 8, 2024 17:33
Copy link
Collaborator

@mkeeter mkeeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@hawkw hawkw merged commit abfdfbe into master Apr 8, 2024
103 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants