OpenDevicePartnership / OpenDevicePartnership/embedded-sensors

Double space in async trait docs generated by decl_threshold_traits!

Open Beginner friendly
#58 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation good first issue
Dominant language
Rust
Stars
4
Forks
9
Avg merge
5d 13h
Merged PRs (30d)
3

Description

Problem

In embedded-sensors/src/sensor.rs, the blocking arm passes doc_suffix = "synchronously" while the async arm passes doc_suffix = " asynchronously" - with a leading space. The surrounding concat! already inserts the separating space, so every async-generated trait doc renders with a double space:

Set Temperature thresholds  asynchronously.

Suggested fix

Drop the leading space from the async doc_suffix.

Related nit (same code path)

stringify!($SensorName) produces the un-spaced identifier, so docs read "Set RelativeHumidity thresholds ..." rather than "Set relative humidity thresholds ...". Consider threading a separate human-readable $display_name string literal through the macro alongside $unit.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open embedded-sensors/src/sensor.rs and inspect the blocking and async arms of decl_threshold_traits!. Start by comparing their doc_suffix values. Done means the async-generated trait documentation renders with a single space, with the related human-readable sensor-name improvement considered separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
embedded-iot
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.