Fix bare_trait_objects deprecation

This commit is contained in:
Zhiming Wang
2020-05-31 14:08:25 +08:00
parent d3c10e4068
commit 13a2354a2c
3 changed files with 5 additions and 5 deletions

View File

@ -11,13 +11,13 @@ use {Codec, Error};
pub struct Context { pub struct Context {
ptr: *mut AVCodecContext, ptr: *mut AVCodecContext,
owner: Option<Rc<Drop>>, owner: Option<Rc<dyn Drop>>,
} }
unsafe impl Send for Context {} unsafe impl Send for Context {}
impl Context { impl Context {
pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option<Rc<Drop>>) -> Self { pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option<Rc<dyn Drop>>) -> Self {
Context { Context {
ptr: ptr, ptr: ptr,
owner: owner, owner: owner,

View File

@ -6,13 +6,13 @@ use media;
pub struct Parameters { pub struct Parameters {
ptr: *mut AVCodecParameters, ptr: *mut AVCodecParameters,
owner: Option<Rc<Drop>>, owner: Option<Rc<dyn Drop>>,
} }
unsafe impl Send for Parameters {} unsafe impl Send for Parameters {}
impl Parameters { impl Parameters {
pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option<Rc<Drop>>) -> Self { pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option<Rc<dyn Drop>>) -> Self {
Parameters { Parameters {
ptr: ptr, ptr: ptr,
owner: owner, owner: owner,

View File

@ -937,7 +937,7 @@ impl error::Error for ParsePixelError {
} }
} }
fn cause(&self) -> Option<&error::Error> { fn cause(&self) -> Option<&dyn error::Error> {
match *self { match *self {
ParsePixelError::NulError(ref e) => Some(e), ParsePixelError::NulError(ref e) => Some(e),
ParsePixelError::UnknownFormat => None, ParsePixelError::UnknownFormat => None,