refactor(mqtt): replace the too_many_arguments suppressions in embedded/ with a context struct

Aperta
#461 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
embedded-iot

Direzione di ricerca

Read the seven clippy::too_many_arguments sites listed in aimdb-mqtt-connector/src/embedded/session_loop.rs, session.rs, tls.rs, and mod.rs, then trace which parameters they share. Group the common parameters into one or two context structs and remove the suppressions that are no longer needed. Run make test-embedded and the bench gate; done means the checks pass without increasing future sizes on the embedded target.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

📱 embedded enhancement

Problem

aimdb-mqtt-connector/src/embedded/ suppresses clippy::too_many_arguments in seven places:

  • session_loop.rs:81, :152, :310
  • session.rs:50
  • tls.rs:317
  • mod.rs:370, :428

The same group of parameters is evidently threaded through the session entry points, the session loop and the TLS path. That usually means a missing "session context" struct: adding one more piece of state today means touching every signature in the chain.

The crate also has the most features in the workspace (17 in aimdb-mqtt-connector/Cargo.toml), and mod.rs:489 / :516 carry #[allow(unreachable_code)], so this is the connector where configuration complexity is highest.

Suggested work

  • Identify the parameters common to those seven functions and group them into one or two structs (e.g. connection config vs. per-session buffers/channels), passed by reference.
  • Remove the too_many_arguments allows that become unnecessary.
  • Check that the change does not grow future sizes on the embedded target (make test-embedded and the bench gate).

Notes

Found from the lint suppressions alone at d9c7be0; I did not trace each signature, so how many of the seven collapse onto the same struct is to be confirmed when doing the work.

Lingua principale
Rust
Stelle
101
Fork
20
Merge medio
2h 33m
PR unite (30g)
90

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di aimdb-dev/aimdb

Tutte le issue di aimdb-dev/aimdb

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.