Remove the config iterator types from `DeviceTrait`

Aperta
#1,434 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with the DeviceTrait definitions in src/traits.rs at the linked lines, then inspect the host implementations of supported_input_configs() and supported_output_configs() to confirm their iterator return types. Change the API to return vectors and check affected custom host implementations or tests. Done means the trait and implementations agree and the project builds successfully.

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

Descrizione

API design

https://github.com/RustAudio/cpal/blob/44ba7ad0c413d10de12f179091423a569a73395c/src/traits.rs#L129-L133

I suggest removing these in favor of just returning a Vec<T> from supported_in/output_configs(), since they are cumbersome to work with, and config enumeration is a fairly cold path. But more importantly:

Every single host already uses std::vec::Iter<T> here anyway 😅

This may break custom hosts, but the fix is as simple as calling .collect()

Lingua principale
Rust
Stelle
4k
Fork
554
Merge medio
1g 3h
PR unite (30g)
1

Preparare l'ambiente

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 RustAudio/cpal

Tutte le issue di RustAudio/cpal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.