project-chip / rs-matter

Rust implementation of the Matter protocol. Status: Experimental
Apache License 2.0
329 stars 45 forks source link

Fix the example section of the cargo generated documentation #87

Closed ssnover closed 1 year ago

ssnover commented 1 year ago

Added code tags so that the generated documentation is formatted directly (cargo doc --open).

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

ssnover commented 1 year ago

It looks like the restyled job is using an outdated version of Rust, it isn't accepting async fn in rs-matter/src/core.rs:179.

debug    Digest: sha256:79c2280e0f35c3e27411cba65d860b98cf68dbaee60d653883090b079d6d70c1
debug    Status: Downloaded newer image for restyled/restyler-rustfmt:v1.5.2-stable
debug    error[E0670]: `async fn` is not permitted in Rust 2015
debug       --> /code/rs-matter/src/core.rs:179:9
debug        |                          
debug    179 |     pub async fn wait_changed(&self) {
debug        |         ^^^^^ to use `async fn`, switch to Rust 2018 or later
debug        |                          
debug        = help: pass `--edition 2021` to `rustc`
debug        = note: for more on editions, read https://doc.rust-lang.org/edition-guide
debug    Error writing files: failed to resolve mod `core`: cannot parse /code/rs-matter/src/core.rs

They recommend specifying the version directly to rustfmt: https://github.com/restyled-io/restyled.io/wiki/Common-Errors:-Rustfmt but I don't see where this job is defined.