*: format code with rustfmt and fix clippy suggestions

* Add avformat_close_input call to clean up AVFormantContext
* Format code with rustfmt
* Fix clippy lint double_parens
* Fix clippy lint deref_addrof
* Fix clippy lint identity_conversion
* Fix clippy lint match_ref_pats
* Fix clippy lint cast_lossless
* Fix clippy lint cmp_null
* Fix clippy lint clone_on_ref_ptr
* Fix clippy lint map_clone
* Fix clippy lint needless_borrow
* Fix clippy lint needless_pass_by_value
* Fix clippy lints for examples
* Fix clippy lint unused_io_amount
* Fix clippy lint new_without_default
* Ignore inline_always clippy lint
* Add vim temp files to .gitignore
This commit is contained in:
Tadas Barzdžius
2018-04-10 17:06:42 +03:00
committed by meh
parent 20c7ef399a
commit 0bcd4550b8
128 changed files with 10643 additions and 10233 deletions

View File

@ -1,30 +1,30 @@
use ffi::*;
use ffi::AVColorRange::*;
use ffi::*;
#[derive(Eq, PartialEq, Clone, Copy, Debug)]
pub enum Range {
Unspecified,
MPEG,
JPEG,
Unspecified,
MPEG,
JPEG,
}
impl From<AVColorRange> for Range {
fn from(value: AVColorRange) -> Self {
match value {
AVCOL_RANGE_UNSPECIFIED => Range::Unspecified,
AVCOL_RANGE_MPEG => Range::MPEG,
AVCOL_RANGE_JPEG => Range::JPEG,
AVCOL_RANGE_NB => Range::Unspecified
}
}
fn from(value: AVColorRange) -> Self {
match value {
AVCOL_RANGE_UNSPECIFIED => Range::Unspecified,
AVCOL_RANGE_MPEG => Range::MPEG,
AVCOL_RANGE_JPEG => Range::JPEG,
AVCOL_RANGE_NB => Range::Unspecified,
}
}
}
impl Into<AVColorRange> for Range {
fn into(self) -> AVColorRange {
match self {
Range::Unspecified => AVCOL_RANGE_UNSPECIFIED,
Range::MPEG => AVCOL_RANGE_MPEG,
Range::JPEG => AVCOL_RANGE_JPEG
}
}
fn into(self) -> AVColorRange {
match self {
Range::Unspecified => AVCOL_RANGE_UNSPECIFIED,
Range::MPEG => AVCOL_RANGE_MPEG,
Range::JPEG => AVCOL_RANGE_JPEG,
}
}
}