Remove the config iterator types from `DeviceTrait`

Abierto
#1,434 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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()

Lenguaje dominante
Rust
Estrellas
4k
Forks
554
Merge medio
1 d 3 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RustAudio/cpal

Todos los issues de RustAudio/cpal

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.