Small improvements (#27)

* Return error instead of panicking if reader buffer is inadequate
* Simplify loop
* Remove unnecessary mut
* Simplify increment
* Improve variable name
* Simplify loop
* Simplify loops
* Improve documentation and simplify loop
This commit is contained in:
Diego Barrios Romero
2023-04-03 14:28:57 +02:00
committed by GitHub
parent 74f6e49507
commit e94672fd96
6 changed files with 19 additions and 60 deletions

View File

@@ -68,7 +68,7 @@ fn test_decode() {
0x15,
];
let mut connack_res = ConnackPacket::<2>::new();
let res = connack_res.decode(&mut BuffReader::new(&mut buffer, 8));
let res = connack_res.decode(&mut BuffReader::new(&buffer, 8));
assert!(res.is_ok());
assert_eq!(connack_res.property_len, 3);