Remove panic! from writer.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
8a8ca0ba27
commit
d6ac1eb3bb
|
@ -34,7 +34,7 @@ fn write_sound_data(block: &BlockType) -> Result<Vec<u8>, Error> {
|
|||
Codec::Pcm16BitSigned => 4,
|
||||
Codec::Alaw => 5,
|
||||
Codec::Ulaw => 6,
|
||||
_ => panic!("Invalid codec"),
|
||||
_ => return Err(Error::new(ErrorKind::Other, "Invalid codec")),
|
||||
};
|
||||
bytes.extend_from_slice(&[codec_id]);
|
||||
bytes.extend_from_slice(data);
|
||||
|
@ -144,7 +144,7 @@ fn write_extra_information(block: &BlockType) -> Result<Vec<u8>, Error> {
|
|||
Codec::Pcm16BitSigned => 4,
|
||||
Codec::Alaw => 5,
|
||||
Codec::Ulaw => 6,
|
||||
_ => panic!("Invalid codec"),
|
||||
_ => return Err(Error::new(ErrorKind::Other, "Invalid codec")),
|
||||
};
|
||||
bytes.extend_from_slice(&[codec_id]);
|
||||
bytes.extend_from_slice(&[*channels]);
|
||||
|
|
Loading…
Reference in New Issue