diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2023-04-12 22:13:44 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-12 22:13:44 +0000 |
| commit | 5a03b2e9e802626127038cff5634795f576f1c69 (patch) | |
| tree | dc283068d72f8e14dcc14aeaff314c23f8827f0e /examples/wasm | |
| parent | ba8cafb20c2458a2016c7db3efd91d718f1a91b6 (diff) | |
| parent | 4863f88d02ca1821eac534729fb9ba347a8c6726 (diff) | |
Merge #1359
1359: Make Hertz constructors `const` r=Dirbaio a=sgoll
This PR makes `Hertz` associated functions `hz()`, `khz()`, `mhz()` and their unassociated variants `const`, allowing `Hertz` to be used more easily in constant values:
```rust
const FREQ1: Hertz = Hertz::khz(120);
const FREQ2: Hertz = mhz(1);
```
This follows the pattern used for similar types such as `Duration` and `Instant`, from `embassy-time/src/duration.rs` and `embassy-time/src/instant.rs`, respectively.
https://github.com/embassy-rs/embassy/blob/ba8cafb20c2458a2016c7db3efd91d718f1a91b6/embassy-time/src/duration.rs#L44-L47
https://github.com/embassy-rs/embassy/blob/ba8cafb20c2458a2016c7db3efd91d718f1a91b6/embassy-time/src/instant.rs#L29-L34
Co-authored-by: Sebastian Goll <[email protected]>
Diffstat (limited to 'examples/wasm')
0 files changed, 0 insertions, 0 deletions
