···437437 if off >= len then Error (Truncated { need = off + 1; have = len })
438438 else
439439 let control =
440440- Result.get_ok
441441- (Wire.decode_bytes control_typ (Bytes.sub data off 1))
440440+ Result.get_ok (Wire.decode_bytes control_typ (Bytes.sub data off 1))
442441 in
443442 let off = off + 1 in
444443 (* PID (only for I and UI frames) *)
445444 let pid, off =
446445 match control with
447447- | UI | I _ when off < len ->
446446+ | (UI | I _) when off < len ->
448447 let p =
449449- Result.get_ok
450450- (Wire.decode_bytes pid_typ (Bytes.sub data off 1))
448448+ Result.get_ok (Wire.decode_bytes pid_typ (Bytes.sub data off 1))
451449 in
452450 (Some p, off + 1)
453451 | UI | I _ -> (None, off)
···479477 let frame_data = Bytes.sub data 0 (len - 2) in
480478 let fcs_expected = crc_ccitt frame_data in
481479 let fcs_actual =
482482- Result.get_ok
483483- (Wire.decode_bytes fcs_typ (Bytes.sub data (len - 2) 2))
480480+ Result.get_ok (Wire.decode_bytes fcs_typ (Bytes.sub data (len - 2) 2))
484481 in
485482 if fcs_expected <> fcs_actual then
486483 Error (Invalid_fcs { expected = fcs_expected; actual = fcs_actual })