Skip to content

Commit eac5a32

Browse files
author
apolunar
committed
improved error handling pt 2
1 parent 5f1b057 commit eac5a32

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/decoder/symphonia.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,15 @@ impl SymphoniaDecoder {
7777
};
7878

7979
// Select the first supported track
80-
let track_id = match probed
80+
let track_id = probed
8181
.format
8282
.tracks()
8383
.iter()
8484
.find(|t| t.codec_params.codec != CODEC_TYPE_NULL)
85-
{
86-
Some(track) => track.id,
87-
None => {
88-
return Err(symphonia::core::errors::Error::Unsupported(
89-
"No track with supported codec",
90-
))
91-
}
92-
};
85+
.ok_or(symphonia::core::errors::Error::Unsupported(
86+
"No track with supported codec",
87+
))?
88+
.id;
9389

9490
let track = probed
9591
.format

0 commit comments

Comments
 (0)