uril::color::*: .name() returns None if unspecified

pixdesc "helpfully" returns "unknown", which renders our Option pointless.
This commit is contained in:
Zhiming Wang
2018-09-14 21:30:50 -04:00
parent 10d3b75342
commit 2d3a34f74d
4 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,9 @@ pub enum Range {
impl Range {
pub fn name(&self) -> Option<&'static str> {
if *self == Range::Unspecified {
return None;
}
unsafe {
let ptr = av_color_range_name((*self).into());
if ptr.is_null() {