Just a heads up: version v2.18 (just released) of libpulse-binding comes with a minor compatibility breaking change which affects your crate. I was browsing the set of dependant crates and noticed the problem so I thought I'd point it out.
The change in question is that the From impl for converting PAErr to Code has been replaced with a TryFrom impl, now that TryFrom has been stable for a while and considering that the conversion is fallible (in the unlikely event that PulseAudio emitted an error number that did not match a Code enum variant, it would be silently converted to Code::Unknown, which is not really a problem but not perfectly correct, so a change was made to allow users the choice of how to deal with it).
You can fix this by:
Bumping the dependency to 2.18+ obviously.
Adding use std::convert::TryFrom; to src/errors.rs.
Replacing let code: Code = error.into(); with let code = Code::try_from(error).unwrap_or(Code::Unknown);.
Btw, there's also a warning being generated due to unnecessary parenthesis within volume_from_percent().
(I thought I'd let you make the change rather than submitting a PR)
Hi,
Just a heads up: version v2.18 (just released) of libpulse-binding comes with a minor compatibility breaking change which affects your crate. I was browsing the set of dependant crates and noticed the problem so I thought I'd point it out.
The change in question is that the
From
impl for convertingPAErr
toCode
has been replaced with aTryFrom
impl, now thatTryFrom
has been stable for a while and considering that the conversion is fallible (in the unlikely event that PulseAudio emitted an error number that did not match aCode
enum variant, it would be silently converted toCode::Unknown
, which is not really a problem but not perfectly correct, so a change was made to allow users the choice of how to deal with it).You can fix this by:
use std::convert::TryFrom;
tosrc/errors.rs
.let code: Code = error.into();
withlet code = Code::try_from(error).unwrap_or(Code::Unknown);
.Btw, there's also a warning being generated due to unnecessary parenthesis within
volume_from_percent()
.(I thought I'd let you make the change rather than submitting a PR)