panic -> unreachable
This commit is contained in:
parent
72edd1327a
commit
f081470b1e
|
@ -106,7 +106,7 @@ impl<'a, 'b, R: Read> Decoder<'a, 'b, R> {
|
|||
match *self.buf {
|
||||
Some(Some(v)) => Ok(v),
|
||||
Some(None) => Err(Error::Eof),
|
||||
None => panic!()
|
||||
None => unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ impl<'a, 'b, R: Read> Decoder<'a, 'b, R> {
|
|||
|
||||
pub fn readbytes(&mut self, n: usize) -> Result<Vec<u8>> {
|
||||
if (*self.buf).is_some() {
|
||||
panic!();
|
||||
unreachable!();
|
||||
}
|
||||
let mut bs = vec![0; n];
|
||||
match self.read.read_exact(&mut bs) {
|
||||
|
@ -280,7 +280,7 @@ impl<'a, 'b, R: Read> Decoder<'a, 'b, R> {
|
|||
let n = if arg > 12 { i32::from(arg) - 16 } else { i32::from(arg) };
|
||||
Ok(Value::from(n).wrap())
|
||||
}
|
||||
(Op::Misc(_), _) => panic!(),
|
||||
(Op::Misc(_), _) => unreachable!(),
|
||||
(Op::Atom(minor), arg) => {
|
||||
let count = self.wirelength(arg)?;
|
||||
Self::decodebinary(minor, self.readbytes(count)?)
|
||||
|
|
Loading…
Reference in New Issue