Difficulty: easy · Estimate: 2–3 hours
The no_std Display impl for DbError currently prints only the category code and a generic message ("Error 0x1002: Connection failed"). Most variants carry numeric data (size, lag_count, record_id, id, component, error_code) that's still available without std and is highly useful when debugging on an MCU where you can't pull in Strings.
Where to look
What to do
For each variant that carries no_std-available numeric fields, include them in the Display output:
BufferFull { size } → "Error 0x2002: Buffer full ({size} items)"
BufferLagged { lag_count } → "Error 0xA001: Buffer lagged ({lag_count} messages)"
InvalidRecordId { id } → include id
TypeMismatch { record_id } → include record_id
AmbiguousType { count } → include count
HardwareError { component, error_code } → include both
Internal { code } → include code
ResourceUnavailable { resource_type } → include resource_type
Keep output bounded: no allocations, use write! directly.
Done when
- Every variant's no_std Display includes its no_std-available data
- A new
#[cfg(not(feature = "std"))] test exercises a few variants and asserts on substring content
cargo build --no-default-features still works
We'd love help with this — comment if you'd like to take it.
Difficulty: easy · Estimate: 2–3 hours
The
no_stdDisplayimpl forDbErrorcurrently prints only the category code and a generic message ("Error 0x1002: Connection failed"). Most variants carry numeric data (size,lag_count,record_id,id,component,error_code) that's still available withoutstdand is highly useful when debugging on an MCU where you can't pull inStrings.Where to look
no_stdDisplay implWhat to do
For each variant that carries no_std-available numeric fields, include them in the Display output:
BufferFull { size }→"Error 0x2002: Buffer full ({size} items)"BufferLagged { lag_count }→"Error 0xA001: Buffer lagged ({lag_count} messages)"InvalidRecordId { id }→ includeidTypeMismatch { record_id }→ includerecord_idAmbiguousType { count }→ includecountHardwareError { component, error_code }→ include bothInternal { code }→ includecodeResourceUnavailable { resource_type }→ includeresource_typeKeep output bounded: no allocations, use
write!directly.Done when
#[cfg(not(feature = "std"))]test exercises a few variants and asserts on substring contentcargo build --no-default-featuresstill worksWe'd love help with this — comment if you'd like to take it.