Fix clippy::redundant_pattern_matching

This commit is contained in:
Marijn Suijten 2021-01-02 17:49:11 +01:00
parent 61270a337b
commit 1a7c4c14cc
2 changed files with 10 additions and 5 deletions

View file

@ -190,7 +190,7 @@ clippy:
rules:
- when: 'always'
script:
- cargo clippy --locked --color=always --all --all-features --all-targets -- -A clippy::redundant_pattern_matching -A clippy::single_match -A clippy::cast_lossless -A clippy::manual_range_contains -D warnings
- cargo clippy --locked --color=always --all --all-features --all-targets -- -A clippy::single_match -A clippy::cast_lossless -A clippy::manual_range_contains -D warnings
deny:
extends: .img-stable

View file

@ -213,13 +213,18 @@ impl State {
let res = if let Some(buffer) = buffer {
let mut map = match buffer.map_writable() {
Ok(map) => map,
Err(_) => {
gst_error!(CAT, obj: pad, "Failed to map provided buffer writable");
Err(e) => {
gst_error!(
CAT,
obj: pad,
"Failed to map provided buffer writable: {}",
e
);
return Err(gst::FlowError::Error);
}
};
if let Err(_) = self.adapter.copy(0, &mut map[..available_size]) {
gst_error!(CAT, obj: pad, "Failed to copy into provided buffer");
if let Err(e) = self.adapter.copy(0, &mut map[..available_size]) {
gst_error!(CAT, obj: pad, "Failed to copy into provided buffer: {}", e);
return Err(gst::FlowError::Error);
}
if map.len() != available_size {