Fix clippy::redundant_field_names

This commit is contained in:
Zhiming Wang
2020-07-26 01:01:13 +08:00
parent ceb1a7ea7c
commit 73b66ea438
38 changed files with 69 additions and 93 deletions
+3 -3
View File
@@ -116,9 +116,9 @@ fn transcoder<P: AsRef<Path>>(
Ok(Transcoder {
stream: input.index(),
filter: filter,
decoder: decoder,
encoder: encoder,
filter,
decoder,
encoder,
})
}
+4 -4
View File
@@ -11,7 +11,7 @@ pub struct Audio {
impl Audio {
pub unsafe fn new(codec: Codec) -> Audio {
Audio { codec: codec }
Audio { codec }
}
}
@@ -63,7 +63,7 @@ pub struct RateIter {
impl RateIter {
pub fn new(ptr: *const i32) -> Self {
RateIter { ptr: ptr }
RateIter { ptr }
}
}
@@ -90,7 +90,7 @@ pub struct FormatIter {
impl FormatIter {
pub fn new(ptr: *const AVSampleFormat) -> Self {
FormatIter { ptr: ptr }
FormatIter { ptr }
}
}
@@ -117,7 +117,7 @@ pub struct ChannelLayoutIter {
impl ChannelLayoutIter {
pub fn new(ptr: *const u64) -> Self {
ChannelLayoutIter { ptr: ptr }
ChannelLayoutIter { ptr }
}
pub fn best(self, max: i32) -> ChannelLayout {
+2 -2
View File
@@ -15,7 +15,7 @@ unsafe impl Sync for Codec {}
impl Codec {
pub unsafe fn wrap(ptr: *mut AVCodec) -> Self {
Codec { ptr: ptr }
Codec { ptr }
}
pub unsafe fn as_ptr(&self) -> *const AVCodec {
@@ -106,7 +106,7 @@ pub struct ProfileIter {
impl ProfileIter {
pub fn new(id: Id, ptr: *const AVProfile) -> Self {
ProfileIter { id: id, ptr: ptr }
ProfileIter { id, ptr }
}
}
+1 -4
View File
@@ -18,10 +18,7 @@ unsafe impl Send for Context {}
impl Context {
pub unsafe fn wrap(ptr: *mut AVCodecContext, owner: Option<Rc<dyn Drop>>) -> Self {
Context {
ptr: ptr,
owner: owner,
}
Context { ptr, owner }
}
pub unsafe fn as_ptr(&self) -> *const AVCodecContext {
+1 -4
View File
@@ -18,10 +18,7 @@ impl<'a> Borrow<'a> {
packet.data = data.as_ptr() as *mut _;
packet.size = data.len() as c_int;
Borrow {
packet: packet,
data: data,
}
Borrow { packet, data }
}
}
+1 -1
View File
@@ -282,7 +282,7 @@ pub struct SideDataIter<'a> {
impl<'a> SideDataIter<'a> {
pub fn new(ptr: *const AVPacket) -> Self {
SideDataIter {
ptr: ptr,
ptr,
cur: 0,
_marker: PhantomData,
}
+1 -1
View File
@@ -155,7 +155,7 @@ pub struct SideData<'a> {
impl<'a> SideData<'a> {
pub unsafe fn wrap(ptr: *mut AVPacketSideData) -> Self {
SideData {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
+1 -4
View File
@@ -13,10 +13,7 @@ unsafe impl Send for Parameters {}
impl Parameters {
pub unsafe fn wrap(ptr: *mut AVCodecParameters, owner: Option<Rc<dyn Drop>>) -> Self {
Parameters {
ptr: ptr,
owner: owner,
}
Parameters { ptr, owner }
}
pub unsafe fn as_ptr(&self) -> *const AVCodecParameters {
+8 -8
View File
@@ -26,11 +26,11 @@ impl<'a> Picture<'a> {
height: u32,
) -> Self {
Picture {
ptr: ptr,
ptr,
format: format,
width: width,
height: height,
format,
width,
height,
_own: false,
_marker: PhantomData,
@@ -62,11 +62,11 @@ impl<'a> Picture<'a> {
match avpicture_alloc(ptr, format.into(), width as c_int, height as c_int) {
0 => Ok(Picture {
ptr: ptr,
ptr,
format: format,
width: width,
height: height,
format,
width,
height,
_own: true,
_marker: PhantomData,
+2 -2
View File
@@ -131,7 +131,7 @@ pub struct RectIter<'a> {
impl<'a> RectIter<'a> {
pub fn new(ptr: *const AVSubtitle) -> Self {
RectIter {
ptr: ptr,
ptr,
cur: 0,
_marker: PhantomData,
}
@@ -175,7 +175,7 @@ pub struct RectMutIter<'a> {
impl<'a> RectMutIter<'a> {
pub fn new(ptr: *mut AVSubtitle) -> Self {
RectMutIter {
ptr: ptr,
ptr,
cur: 0,
_marker: PhantomData,
}
+3 -3
View File
@@ -55,7 +55,7 @@ pub struct Bitmap<'a> {
impl<'a> Bitmap<'a> {
pub unsafe fn wrap(ptr: *const AVSubtitleRect) -> Self {
Bitmap {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
@@ -108,7 +108,7 @@ pub struct Text<'a> {
impl<'a> Text<'a> {
pub unsafe fn wrap(ptr: *const AVSubtitleRect) -> Self {
Text {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
@@ -133,7 +133,7 @@ pub struct Ass<'a> {
impl<'a> Ass<'a> {
pub unsafe fn wrap(ptr: *const AVSubtitleRect) -> Self {
Ass {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
+3 -3
View File
@@ -11,7 +11,7 @@ pub struct Video {
impl Video {
pub unsafe fn new(codec: Codec) -> Video {
Video { codec: codec }
Video { codec }
}
}
@@ -51,7 +51,7 @@ pub struct RateIter {
impl RateIter {
pub fn new(ptr: *const AVRational) -> Self {
RateIter { ptr: ptr }
RateIter { ptr }
}
}
@@ -78,7 +78,7 @@ pub struct FormatIter {
impl FormatIter {
pub fn new(ptr: *const AVPixelFormat) -> Self {
FormatIter { ptr: ptr }
FormatIter { ptr }
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ impl<'a> DeviceIter<'a> {
n if n < 0 => Err(Error::from(n)),
_ => Ok(DeviceIter {
ptr: ptr,
ptr,
cur: 0,
_marker: PhantomData,
}),
+1 -1
View File
@@ -17,7 +17,7 @@ pub struct Info<'a> {
impl<'a> Info<'a> {
pub unsafe fn wrap(ptr: *mut AVDeviceInfo) -> Self {
Info {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ pub struct Context<'a> {
impl<'a> Context<'a> {
pub unsafe fn wrap(ptr: *mut AVFilterContext) -> Self {
Context {
ptr: ptr,
ptr,
_marker: PhantomData,
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ pub struct Sink<'a> {
impl<'a> Sink<'a> {
pub unsafe fn wrap<'b>(ctx: &'b mut Context<'b>) -> Sink<'b> {
Sink { ctx: ctx }
Sink { ctx }
}
}
+1 -1
View File
@@ -10,7 +10,7 @@ pub struct Source<'a> {
impl<'a> Source<'a> {
pub unsafe fn wrap<'b>(ctx: &'b mut Context<'b>) -> Source<'b> {
Source { ctx: ctx }
Source { ctx }
}
}
+2 -2
View File
@@ -11,7 +11,7 @@ pub struct Filter {
impl Filter {
pub unsafe fn wrap(ptr: *mut AVFilter) -> Self {
Filter { ptr: ptr }
Filter { ptr }
}
pub unsafe fn as_ptr(&self) -> *const AVFilter {
@@ -79,7 +79,7 @@ pub struct PadIter<'a> {
impl<'a> PadIter<'a> {
pub fn new(ptr: *const AVFilterPad) -> Self {
PadIter {
ptr: ptr,
ptr,
cur: 0,
_marker: PhantomData,
}
+2 -2
View File
@@ -16,7 +16,7 @@ unsafe impl Sync for Graph {}
impl Graph {
pub unsafe fn wrap(ptr: *mut AVFilterGraph) -> Self {
Graph { ptr: ptr }
Graph { ptr }
}
pub unsafe fn as_ptr(&self) -> *const AVFilterGraph {
@@ -136,7 +136,7 @@ pub struct Parser<'a> {
impl<'a> Parser<'a> {
pub fn new(graph: &mut Graph) -> Parser {
Parser {
graph: graph,
graph,
inputs: ptr::null_mut(),
outputs: ptr::null_mut(),
}
+2 -2
View File
@@ -15,8 +15,8 @@ pub struct Pad<'a> {
impl<'a> Pad<'a> {
pub unsafe fn wrap(ptr: *const AVFilterPad, idx: isize) -> Self {
Pad {
ptr: ptr,
idx: idx,
ptr,
idx,
_marker: PhantomData,
}
}

Some files were not shown because too many files have changed in this diff Show More