From 2bbd244fc78b70b14c816a5af116ddbcf60ec353 Mon Sep 17 00:00:00 2001 From: tilpner Date: Fri, 21 Apr 2023 14:14:10 +0200 Subject: [PATCH] chore(codec/context): use `dyn Any` over `dyn Drop` to silence mem::needs_drop warning --- src/codec/context.rs | 6 +++--- src/codec/parameters.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/codec/context.rs b/src/codec/context.rs index bbaae35..8d2e266 100644 --- a/src/codec/context.rs +++ b/src/codec/context.rs @@ -1,4 +1,4 @@ -use std::{ptr, rc::Rc}; +use std::{any::Any, ptr, rc::Rc}; use libc::c_int; @@ -9,13 +9,13 @@ use crate::{ffi::*, media, Codec, Error, Rational}; pub struct Context { ptr: *mut AVCodecContext, - owner: Option>, + owner: Option>, } unsafe impl Send for Context {} impl Context { - pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option>) -> Self { + pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option>) -> Self { Context { ptr, owner } } diff --git a/src/codec/parameters.rs b/src/codec/parameters.rs index aa59a8d..8c974d3 100644 --- a/src/codec/parameters.rs +++ b/src/codec/parameters.rs @@ -1,17 +1,17 @@ -use std::rc::Rc; +use std::{any::Any, ops::Deref, rc::Rc}; use super::{Context, Id}; use crate::{ffi::*, media}; pub struct Parameters { ptr: *mut AVCodecParameters, - owner: Option>, + owner: Option>, } unsafe impl Send for Parameters {} impl Parameters { - pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option>) -> Self { + pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option>) -> Self { Parameters { ptr, owner } }