Skip to content

Commit 0cd1401

Browse files
committed
Fixup warnings
1 parent 4851de2 commit 0cd1401

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/ctl_int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const ELEM_ID_SIZE: usize = 64;
2424
pub struct DeviceIter<'a>(&'a Ctl, c_int);
2525

2626
impl<'a> DeviceIter<'a>{
27-
pub fn new(ctl: &'a Ctl) -> DeviceIter {
27+
pub fn new(ctl: &'a Ctl) -> DeviceIter<'a> {
2828
DeviceIter(ctl, -1)
2929
}
3030
}

src/hctl.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
//! }
2626
//! ```
2727
28+
#![allow(dead_code)]
29+
/* There is a "field is never read" warning for the ElemIter struct. We still need to hold on
30+
to the HCtl pointer somehow; to guarantee that the HCtl does not go out of scope while we use
31+
ElemIter, which would make the snd_hctl_elem_t pointer invalid. Hence the decision to allow dead code here.
32+
I suppose there is a better solution for this but I'm not sure how.
33+
*/
34+
35+
2836
use crate::{alsa, Card};
2937
use std::ffi::{CStr, CString};
3038
use super::error::*;

0 commit comments

Comments
 (0)