We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3dcf534 commit 128e869Copy full SHA for 128e869
src/sys/native.rs
@@ -1170,8 +1170,10 @@ impl SysBackend for NativeSys {
1170
}
1171
#[cfg(feature = "webcam")]
1172
fn webcam_list(&self) -> Result<Vec<String>, String> {
1173
- Ok(nokhwa::query(nokhwa::utils::ApiBackend::Auto)
1174
- .map_err(|e| e.to_string())?
+ let mut cam_infos =
+ nokhwa::query(nokhwa::utils::ApiBackend::Auto).map_err(|e| e.to_string())?;
1175
+ cam_infos.sort_by_key(|info| info.index().clone());
1176
+ Ok(cam_infos
1177
.into_iter()
1178
.map(|info| info.human_name())
1179
.collect())
0 commit comments