Skip to content

Commit 0f38966

Browse files
authored
fix: import the right types
1 parent b75f433 commit 0f38966

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/util/color/primaries.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::ffi::{AVColorPrimaries::*, *};
2+
use std::ffi::CStr;
23

34
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
45
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -30,7 +31,7 @@ impl Primaries {
3031
}
3132
unsafe {
3233
let ptr = av_color_primaries_name((*self).into());
33-
ptr.as_ref().map(|ptr| from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
34+
ptr.as_ref().map(|ptr| std::str::from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
3435
}
3536
}
3637
}

src/util/color/range.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::ffi::{AVColorRange::*, *};
2+
use std::ffi::CStr;
23

34
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
45
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -16,7 +17,7 @@ impl Range {
1617
}
1718
unsafe {
1819
let ptr = av_color_range_name((*self).into());
19-
ptr.as_ref().map(|ptr| from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
20+
ptr.as_ref().map(|ptr| std::str::from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
2021
}
2122
}
2223
}

src/util/color/transfer_characteristic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use crate::ffi::{AVColorTransferCharacteristic::*, *};
2+
use std::ffi::CStr;
23

34
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
45
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -32,7 +33,7 @@ impl TransferCharacteristic {
3233
}
3334
unsafe {
3435
let ptr = av_color_transfer_name((*self).into());
35-
ptr.as_ref().map(|ptr| from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
36+
ptr.as_ref().map(|ptr| std::str::from_utf8_unchecked(CStr::from_ptr(ptr).to_bytes()))
3637
}
3738
}
3839
}

0 commit comments

Comments
 (0)