Commit c8bd6b9
authored
Depanic effort (#10)
This pull request introduces several improvements to code quality,
safety, and CI workflows. The most significant changes include stricter
linting rules, improvements to the `SA0` enum, and updates to the GitHub
Actions workflow for CI checks.
**Linting and Code Safety Improvements:**
* Added a `[lints.rust]` section to `Cargo.toml` to forbid the use of
`unsafe_code`. Updated `[lints.clippy]` to deny a broader set of lints,
including `unwrap_used`, `todo`, `unimplemented`, and others, making the
codebase more robust and less prone to runtime errors.
* Added `#[allow(clippy::unwrap_used)]` with safety comments in the
accelerometer reading code, making explicit where `unwrap` is considered
safe due to slice length guarantees.
**Codebase Simplification and Modernization:**
* Updated the `SA0` enum to derive `Default` and use the `#[default]`
attribute for the `Gnd` variant, removing the manual `impl Default`
block and simplifying the code.
**CI/CD Workflow Updates:**
* Replaced the use of the `giraffate/clippy-action` with a direct `cargo
clippy -- -Dwarnings` command in the GitHub Actions workflow,
streamlining the linting process.
* Enabled the previously commented-out `semver` check in the CI
workflow, ensuring that semantic versioning checks are now part of the
automated pipeline.1 parent c93e811 commit c8bd6b9
3 files changed
+37
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 60 | + | |
64 | 61 | | |
65 | 62 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
79 | 76 | | |
80 | 77 | | |
81 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 30 | | |
35 | 31 | | |
36 | 32 | | |
| |||
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
| 179 | + | |
| 180 | + | |
183 | 181 | | |
| 182 | + | |
| 183 | + | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
| |||
0 commit comments