Read a boolean from the value at `offset`.
(buf: &[u8], offset: usize)
| 358 | |
| 359 | /// Read a boolean from the value at `offset`. |
| 360 | pub fn read_bool(buf: &[u8], offset: usize) -> Option<bool> { |
| 361 | match get(buf, offset)? { |
| 362 | TRUE => Some(true), |
| 363 | FALSE => Some(false), |
| 364 | _ => None, |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | /// Check if the value at `offset` is nil. |
| 369 | pub fn read_null(buf: &[u8], offset: usize) -> bool { |