Skip to content

Commit

Permalink
Avoid abbreviations in API
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Dec 19, 2024
1 parent 1fff464 commit a789165
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions documentation/API-GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ In general, the [Rust API Guidelines](https://rust-lang.github.io/api-guidelines
- If a driver only implements a subset of a peripheral's capabilities, it should be placed in the `peripheral::subcategory` module.
- For example, if a driver implements the slave-mode I2C driver, it should be placed into `i2c::slave`.
- This helps us reducing the need of introducing breaking changes if we implement additional functionalities.
- Avoid abbreviations and contractions in the API, where possible.
- Saving a few characters may introduce ambiguity, e.g `SpiTransDone`, is it `Transmit` or `Transfer`?

## Maintainability

Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/i2c/master/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub enum Error {
/// The arbitration for the bus was lost.
ArbitrationLost,
/// The execution of the I2C command was incomplete.
ExecIncomplete,
ExecutionIncomplete,
/// The number of commands issued exceeded the limit.
CommandNrExceeded,
/// Zero length read or write operation.
Expand Down

0 comments on commit a789165

Please sign in to comment.