Skip to content

Commit a529b06

Browse files
authored
Merge pull request #351 from mozilla/clippy-question-mark
Fix `clippy::question-mark` lint
2 parents e133798 + c83f02e commit a529b06

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

mp4parse/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,12 @@ impl From<fallible_collections::TryReserveError> for Status {
227227
}
228228
}
229229

230+
impl From<std::io::Error> for Status {
231+
fn from(_: std::io::Error) -> Self {
232+
Status::Io
233+
}
234+
}
235+
230236
/// Describes parser failures.
231237
///
232238
/// This enum wraps the standard `io::Error` type, unified with

mp4parse_capi/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,12 +1287,7 @@ fn get_pssh_info(
12871287
.try_into()
12881288
.map_err(|_| Mp4parseStatus::Invalid)?;
12891289
let mut data_len = TryVec::new();
1290-
if data_len
1291-
.write_u32::<byteorder::NativeEndian>(content_len)
1292-
.is_err()
1293-
{
1294-
return Err(Mp4parseStatus::Io);
1295-
}
1290+
data_len.write_u32::<byteorder::NativeEndian>(content_len)?;
12961291
pssh_data.extend_from_slice(pssh.system_id.as_slice())?;
12971292
pssh_data.extend_from_slice(data_len.as_slice())?;
12981293
pssh_data.extend_from_slice(pssh.box_content.as_slice())?;

0 commit comments

Comments
 (0)